Do these two source file(i.e. include\c_std\cstdlib and include\c_global\cstdlib) serve for different purposes whereas they contain similar content?

stephen.webb@bregmasoft.ca stephen.webb@bregmasoft.ca
Thu Aug 13 13:06:56 GMT 2020


Quoting Jonathan Wakely via Libstdc++ <libstdc++@gcc.gnu.org>:

> On 12/08/20 20:15 +0800, 孙世龙 sunshilong via Libstdc++ wrote:
>> Hi, list
>>
>> These two source files (i.e. include\c_std\cstdlib and
>> include\c_global\cstdlib) have almost same content.
>> What is their own role?
>> Do these two source files serve for different purposes whereas they
>> contain similar content?
>
> You can ignore the c_std one.
>
> The headers in that directory are only used if you build gcc with
> --enable-cheaders=c_std but nobody does that, and they aren't properly
> maintained any more, and they probably don't work.

To answer the first question, the c_std and c_global set up was to  
accommodate the fact that some target systems had C++ support in their  
libc system headers by putting symbols in the std:: namespace  
requiring their symbols to be hoisted into the global namespace in the  
<c...> headers (the c_std strategy), and some had only support for the  
C language and all their symbols were already in the global namespace  
(the c_global strategy).  I don't believe any of the former systems  
(eg. Solaris 8) are supported by GCC any more.

To answer the second question, no they serve the same purpose but for  
different targets, and which set of headers get used is selected at  
configuration time.



More information about the Libstdc++ mailing list