This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] Prevent GCC 6 <cstdlib> from including /usr/include/stdlib.h


On Sat, 11 Jun 2016, Florian Weimer wrote:

There is a need to wrap around glibc headers (do some stuff before and after <stdlib.h> and other headers are included) to get support for some C++ functionality, in addition to other header file coordination work.

It's not that we do point releases to add C++ support to our headers, so I can see why GCC is doing this.

Note that gcc doesn't need to do it this way. Currently, taking abs as a random example:

libc-stdlib.h declares abs in the global namespace
gcc-cstdlib imports it in namespace std and adds some overloads
gcc-stdlib.h imports the std overloads back to the global namespace

We could just as well have:
libc-stdlib.h declares abs in the global namespace
gcc-stdlib.h adds some overloads in the global namespace
gcc-cstdlib imports the lot in namespace std

where gcc's stdlib.h would #include_next libc's stdlib.h, the usual scenario for #include_next. Would that help or would we get exactly the same issue?

--
Marc Glisse


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