This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

a bug for __builtin_offsetof operator ?


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]