Mail Archives: djgpp-workers/2000/05/16/16:16:22
It is not (as far as I can see) related to the previous discussion:
Excerpt from one GCC internal include file (gcc/system.h):
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
And from DJGPP's stddef.h:
#define offsetof(s_type, mbr) ((size_t) &((s_type *)0)->mbr)
offsetof in DJGPP is defined uncoditionally, so there are lots
of harmless but annoying warnings like
In file included from ../../gcc/../include/libiberty.h:132,
from ../../gcc/system.h:563,
from ../../gcc/cppmain.c:24:
d:/djgpp/include/stddef.h:12: warning: `offsetof' redefined
I see two solutions:
1) as it is done with NULL in stdio.h:
#undef offsetof
#define offsetof we_dont_care_about_previous_def
2) as gcc does
#ifndef offsetof
#define offsetof we_care_about_previous_def
#endif
Which one (or noone) is OK?
Laurynas Biveinis
- Raw text -