Re: error: expected '=', ',', ';', 'asm' or '__attrib



Robert Adsett <subscriptions@xxxxxxxxxxxxxxxxxxxxx> wrote:
In article <MPG.2000d13782aaec369896b1@xxxxxxxxxxxxxxxxx>, Robert Adsett
says...

[dd]

<snip>
/* Structure to declare our file access functions. */
struct file_operations qadc_fops =
{
open: qadc_open,
read: qadc_read,
write: qadc_write,
release: qadc_release
};

Well, the above isn't valid C so I'd start there.

It was some time back but now it's changed.

As of? AFAIR it isn't part of C89/90 and the more recent changes are
not generally available. It's certainly the line the compiler is
complaining about.

I did a little checking, the only reference Ive found to member
initialization in C uses the following syntax

struct point location = { .y = 13, .x = 10 };

No mention of the syntax above. Even that is only present in C99 and so
far from widely available.

Do you have a reference for the validity of the syntax in the original
post?

Look into any 2.4.xx Linux kernel source, e.g. in drivers/mtd/nand look for
nand_base.c if I still remember those older kernels. Or nand_ids.c. There is
a lot of this type structure initializations in there. Then everything
changed to { .member = value } style that is, IMHO, not any better than that
old GCC { member: value } style.

This was _GCC_ extension though you probably won't find it in C/C++
standards. Nowadays this style is considered obsolete and newer GCC uses C99
notation.

---
******************************************************************
* KSI@home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: [RFC PATCH 5/6] gcov: add gcov profiling infrastructure
    ... place the gcov stuff next to, but General setup seems to be a good ... Traditionally we put gcc version checking into init/main.c, ... single callback. ... +struct gcov_ctr_info { ...
    (Linux-Kernel)
  • Re: Buildworld failures - 6.3-PRE
    ... checking for gcc... ... checking shadow.h usability... ... checking shadow.h presence... ... checking for struct dirent.d_ino... ...
    (freebsd-stable)
  • Re: Buildworld failures - 6.3-PRE
    ... checking for gcc... ... checking shadow.h usability... ... checking shadow.h presence... ... checking for struct dirent.d_ino... ...
    (freebsd-stable)
  • Re: Buildworld failures - 6.3-PRE
    ... checking for gcc... ... checking shadow.h usability... ... checking shadow.h presence... ... checking for struct dirent.d_ino... ...
    (freebsd-current)
  • Re: Buildworld failures - 6.3-PRE
    ... checking for gcc... ... checking shadow.h usability... ... checking shadow.h presence... ... checking for struct dirent.d_ino... ...
    (freebsd-current)