a bug for __builtin_offsetof operator ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have following program which is compiled successfully by gcc.

struct A {
  int a;
};

struct B {
struct A a1;
};

int main()  {

__builtin_offsetof(struct B, a1.a);    /* line 11 */

}


However, if I add "()" around the "a1.a" on line 11, ie. line 11 becomes:
  __builtin_offsetof(struct B, (a1.a) );    /* line 11 */


gcc reports:
   foo.c: In function 'main':
   foo.c:11: error: syntax error before '(' token.


I am not sure whether it is a gcc bug.

Regards,

Mike





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux