This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: handling ISO C feature test macros
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 20 May 2016 23:20:18 +0000
- Subject: Re: RFC: handling ISO C feature test macros
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 20 dot 1605202135440 dot 24104 at digraph dot polyomino dot org dot uk> <211c45ed-0546-9bca-21ae-f3b3cf36339f at cs dot ucla dot edu>
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