This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
a bug for __builtin_offsetof operator ?
- From: "Michael Gong" <mwgong at cs dot utoronto dot ca>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 18 Jan 2007 12:05:32 -0500
- Subject: 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