<bits/features.h> setting of __STDC_IEC_559__ not universally accurate

Mark Mitchell mark@codesourcery.com
Tue Mar 29 00:05:00 GMT 2005


At present, <bits/features.h> unconditionally sets __STDC_IEC_559__ to 
1.  This is not accurate on (at least) ARM platforms using software 
floating-point.  On those platforms, <fenv.h> does not define 
FE_INEXACT, and friends, because the software floating-point emulation 
provided by libgcc does not honor those rounding modes.  According to 
the C99 standard, that would seem to preclude setting __STDC_IEC_559__.

But, AFAICT, there is no sysdeps machinery for overriding this setting.

Ideally, the software floating-point emulation would indeed provide full 
IEC 559 conformance.  And, as the CONFORMANCE file indicates, 
__STDC_IEC_559__ should really be defined by the compiler, so that it is 
set throughout the entire translation unit.

Unfortunately, the compiler cannot actually define __STDC_IEC_559__ to 
zero, as <bits/features.h> unconditionally sets it to 1; any aattempted 
assignment by the compiler would be overridden.

So, I think that we should make two changes:

1. Modify GLIBC to provide a sysdeps-specific method for setting 
__STDC_IEC_559__.

2. Make the setting conditional on the fact that the value is not 
already defined, so that the compiler can be enhanced to set the value 
itself.

I'd appreciate any guidance.

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Libc-alpha mailing list