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: RFC: handling ISO C feature test macros


On Fri, 20 May 2016, Paul Eggert wrote:

> On 05/20/2016 03:00 PM, Joseph Myers wrote:
> > (_GNU_SOURCE should not cause __STDC_WANT_IEC_60559_BFP_EXT__ to be
> > defined because the user might define it with a different expansion.
> 
> Is this a pragmatic suggestion, or is this required by the standards? Surely

It's pragmatic.  So that e.g.

#include <stdio.h>
#define __STDC_WANT_IEC_60559_BFP_EXT__
#include <math.h>

which is valid under TS 18661-1 works even if someone defines _GNU_SOURCE, 
or compiles as C++ (g++ defines _GNU_SOURCE by default 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11196> because of the C++ 
practice of having much of the library implementation in the libstdc++ 
headers, which in turn means those headers depend on libc features outside 
of ISO C).  Although of course the only case covered by the standards is 
if the above is compiled with -std=c11 and no other feature test macros, 
since TS 18661-1 is defined as an extension to C11.

-- 
Joseph S. Myers
joseph@codesourcery.com


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