[PATCH v2] scsi/sg.h: include stddef.h for size_t

Joseph S. Myers joseph@codesourcery.com
Sun Jan 13 22:41:00 GMT 2013


On Sun, 13 Jan 2013, Mike Frysinger wrote:

> This header uses size_t but doesn't include stddef.h for it.  So when
> packages happen to include this before any header that defines size_t,
> they get a build failure.

stddef.h defines offsetof; I don't see any good reason for that to be 
defined by this header.  If size_t is all that's wanted from stddef.h, I 
think you should define __need_size_t before the #include to avoid 
bringing in other extraneous definitions such as offsetof.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list