[Pvfs2-developers] offsetof

Sam Lang slang at mcs.anl.gov
Fri Nov 30 13:17:59 EST 2007


Hi Pete,

I removed the #include <malloc.h> and #ifndef offsetof from pvfs2- 
types.h.  There was one instance of offsetof in pvfs2-client-core, so  
I moved the #ifndef offsetof to that point.  Let me know if it works  
on Cray.
-sam

On Nov 30, 2007, at 9:58 AM, Pete Wyckoff wrote:

> slang at mcs.anl.gov wrote on Fri, 30 Nov 2007 09:48 -0800:
>> No complaint, its just that malloc and offsetof are defined in  
>> stddef.h on
>> most linuxes today.  I guess your point is that we don't handle the  
>> case
>> where malloc.h is still used.  As I understand it the problem  
>> you're seeing
>> is that we #include <stddef.h> in some source files ahead of pvfs2- 
>> types.h.
>
> Yes, exactly.
>
>> I would get rid of the specific malloc.h in pvfs2-types.h, and then  
>> maybe
>> remove the stddef.h includes in our sources as well, so that only the
>> pvfs2-types.h includes it.
>>
>> We could also move the #ifndef offsetof to the places where its used
>> (quicklist.h) as well, to avoid the error you're seeing on Cray.
>
> In fact, I don't see quicklist using it---looks like it has inlined
> its own.  There's some kernel usage, but that will pick it up for sure
> in the kernel headers.  Then the unused ncac has its own.
>
> If you are willing to try the above, I'll go do the compile tests
> on Cray and make sure it is all hunkydory still.
>
> 		-- Pete
>



More information about the Pvfs2-developers mailing list