This is the mail archive of the 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]

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

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.


Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

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