This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 17/18] Provide __size_t via <sys/_types.h>


On Apr 14 21:31, Sebastian Huber wrote:
> 
> ----- Corinna Vinschen <vinschen@redhat.com> schrieb:
> > On Apr 14 13:54, Sebastian Huber wrote:
> > > Various FreeBSD source and header files need a typedef __size_t via
> > > <sys/_types.h>.  Unfortunately the GCC provided <stddef.h> uses
> > > 
> > > 	#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
> > > 	  || defined(__DragonFly__) \
> > > 	  || defined(__FreeBSD_kernel__)
> > > 	/* __size_t is a typedef on FreeBSD 5, must not trash it. */
> > > 	#elif defined (__VMS__)
> > > 	/* __size_t is also a typedef on VMS.  */
> > > 	#else
> > > 	#define __size_t
> > > 	#endif
> > > 
> > > and therefore defines __size_t on Newlib targets which would trash a
> > > __size_t typedef.  Include <stddef.h> before <sys/_types.h> in
> > > <sys/types.h> and undefine __size_t in <sys/_types.h> as a workaround.
> > 
> > What about GCC upstream?  Why are they doing that in the first place?
> > What sense does it make to set __size_t to nothing, rather than setting
> > it to __SIZE_TYPE__?
> 
> This FreeBSD workaround in GCC stddef.h is there since 2002 and in
> 2014 the DragonFly workaround was added. I guess they are very
> conservative to change the value of existing defines in GCC, since
> they support so many different platforms.
> 
> > 
> > Did you ask on the gcc list?
> 
> No, but I can ask. Even if the GCC stddef.h is changed, it will need
> months or years before this is available. This patch is not perfect,
> but I am able to build more than 800 FreeBSD user and kernel space
> files with it.

Right.  I just think it would make sense to ask GCC to rethink this
definition even if that only trickles down over months...


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]