From: Stephen L. <sld...@so...> - 2008-02-21 06:04:03
|
Eduardo, You had the same error before and did the 'right thing' to get rid of it: > >> Ok. so I did the right thing and error msg changed. Now gcc is missing > >> sys/wait.h when compiling libiberty/pex_win32.c So what has changed? > > I removed everything from /develop/build and restarted there. > > Unfortunately it didn't end up well. See the errors below. > > > > ../../gcc-4.2.1-2-src/libiberty/objalloc.c: In function `objalloc_create': > > ../../gcc-4.2.1-2-src/libiberty/objalloc.c:106: warning: implicit > > declaration of function `__builtin_offsetof' > > ../../gcc-4.2.1-2-src/libiberty/objalloc.c:106: error: parse error > > before "struct" This came from the line ret->current_ptr = (char *) chunk + CHUNK_HEADER_SIZE; where CHUNK_HEADER_SIZE is #define CHUNK_HEADER_SIZE \ ((sizeof (struct objalloc_chunk) + OBJALLOC_ALIGN - 1) \ &~ (OBJALLOC_ALIGN - 1)) You can find OBJALLOC_ALIGN in include/objalloc.h: /* Work out the required alignment. */ struct objalloc_align { char x; double d; }; #if defined (__STDC__) && __STDC__ #ifndef offsetof #include <stddef.h> #endif #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif #define OBJALLOC_ALIGN offsetof (struct objalloc_align, d) Now, the way you got to __builtin_offsetof is by the stddef.h include, and as the name suggests, it is a gcc builtin so I don't see why it is complaining. Presumably, in the same compile environment everything that includes <stddef.h> and uses offsetof will break in the same way. Why don't you try to write a small test program and see if you can reproduce the error? It should help you figure out what is wrong. -- Stephen Lee <sld...@so...> |