This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10110] Separate __STDC_* predefines from features.h
- From: "joseph at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 16 Jun 2009 16:20:15 -0000
- Subject: [Bug libc/10110] Separate __STDC_* predefines from features.h
- References: <20090428151651.10110.jsm28@gcc.gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From joseph at codesourcery dot com 2009-06-16 16:20 -------
Subject: Re: Separate __STDC_* predefines from features.h
On Tue, 16 Jun 2009, drepper at redhat dot com wrote:
> I don't like this super-complicated mechanism. Just hardcode the values in gcc
> (in the spec file or where else). They must not change anywhere. Then glibc
> can be changed to not redefine them if they are already defined.
GCC could reasonably take responsibility for __STDC_IEC_559__ and
__STDC_IEC_559_COMPLEX__, knowing that glibc implements the library parts
of the requirements, and define a macro to indicate that it has taken
responsibility for these macros. (That would best be a separate macro,
__IEC_559_MACROS_PREDEFINED__ or similar, since options such as
-ffast-math mean the IEEE arithmetic requirements are not being followed
and so these macros shouldn't actually be predefined when certain options
are being used.) But as I noted in the original patch submission this
doesn't work so well for __STDC_ISO_10646__; that *should* change when
glibc is updated for new versions of Unicode; I said:
I strongly suspect that the value of __STDC_ISO_10646__ in glibc is
out of date (the comment says Unicode 3.1 and the value is 200009L,
but there have been subsequent changes updating glibc to Unicode 5).
Updating this (in features.h before this patch or stdc-predef.h after
it) is clearly independent of this patch.
I can implement a fixincludes-based approach, where the GCC build process
extracts the value of __STDC_ISO_10646__ from the installed system headers
(while determining __STDC_IEC_559__ and __STDC_IEC_559_COMPLEX__ directly
based on the options passed to GCC); this would avoid glibc changes being
needed, but make it more important to run the mkheaders script GCC
installs to update the fixed headers when glibc is updated and an existing
GCC installation is not rebuilt. But the preinclusion mechanism in GCC is
still needed for the use the DFP people wish to make of the GCC patch (I
have confirmed they are interested in it), predefining __STDC_DEC_FP__
only when building with -I/usr/include/dfp to get DFP versions of headers
(which include core glibc ones with #include_next); all the complexity
goes in GCC (with some additional complexity to extract values at build
time) and all you avoid is a small glibc patch to put some definitions in
their own header.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10110
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.