excessive stab information

Ian Lance Taylor ian@airs.com
Wed Apr 20 14:59:00 GMT 2005


"Andy Chittenden" <AChittenden@bluearc.com> writes:

> So I've started to rationalise some header files so that there are no
> conditionally compiled chunks of header files as this should make the
> optimisation of stabs work properly. However, one of the culprits is
> sys/types.h that is supposed to define size_t
> <http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
> >. However, size_t is defined by the gcc supplied header file stddef.h.
> One way to deal with this is to #define __need_size_t and #include
> <stddef.h> and get the conditional compilation wizardry in that file to
> deal with it. However, that in its own right is going to cause
> "duplicate" stabs if another compilation unit #includes stddef.h in its
> entirety. If another header file references size_t, then depending on
> how size_t got defined in a particular compilation unit, then a whole
> header file's worth of definition is going to be "duplicated".
> 
> Has anyone got any suggestions as to how to prevent this?

In your program, always include stddef.h before sys/types.h.

Ian



More information about the Binutils mailing list