[EMAIL PROTECTED] wrote on Thu, 29 Nov 2007 16:51 -0800:
> It looks like you added the #include <malloc.h> to pvfs2-types.h to get the
> offsetof macro. That gets defined in stddef.h, and in fact, we define it
> later in the header if its not defined at that point. What's the workaround
> on Cray that requires the offsetof from malloc.h?
I tried taking it out just now to remind myself. Most (but not all)
of the compiled files end up with an error similar to this:
CC src/client/sysint/client-state-machine.o
In file included from /opt/xt-libc/2.0.24a/amd64/include/malloc.h:46,
from ../pvfs2/src/common/llist/llist.h:14,
from ../pvfs2/src/common/misc/server-config.h:11,
from ../pvfs2/src/common/misc/pint-cached-config.h:15,
from ../pvfs2/src/client/sysint/pint-sysint-utils.h:25,
from ../pvfs2/src/client/sysint/client-state-machine.c:14:
/opt/gcc/4.1.2/cnos/lib/gcc-lib/x86_64-suse-linux/4.1.2//include/stddef.h:414:1:
warning: "offsetof" redefined
In file included from ../pvfs2/include/pvfs2-sysint.h:23,
from ../pvfs2/src/client/sysint/client-state-machine.c:13:
../pvfs2/include/pvfs2-types.h:37:1: warning: this is the location of the
previous definition
That stddef.h file is in the normal gcc install. It has the
offsetof() definition at the end of the file. llist.h picks it
up due to needing malloc.h.
Our pvfs2-types.h definition of offsetof comes first, then later the
system stddef.h tries to provide one and spits an error. I just
tried to system include to the top.
If I change the line I added to #include <stddef.h>, things work
just fine. Maybe this is the more correct fix?
Not sure what your complaint about including malloc.h is, but we
probably should change that to stddef.h anyway. Feel free to check
this in yourself, or tell me what should be going on with these
headers.
-- Pete
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers