[cfp-interest 3945] __STDC_IEC_60559_BFP__ value in ISO C23

Vincent Lefevre vincent at vinc17.net
Mon Jun 1 05:33:22 PDT 2026


In ISO C23:

  5.2.5.3.3 Characteristics of floating types <float.h>

  1  [...] An implementation that defines __STDC_IEC_60559_BFP__ or
     __STDC_IEC_559__ shall implement floating types and arithmetic
     conforming to ISO/IEC 60559 as specified in Annex F of this
     document.

but Annex F has:

  F.1 Introduction

  3  An implementation that defines __STDC_IEC_60559_BFP__ to 202311L
     shall conform to the specifications in this annex for binary
     floating-point arithmetic and shall also define __STDC_IEC_559__
     to 1.423)

  423) Implementations that do not define either of
  __STDC_IEC_60559_BFP__ and __STDC_IEC_559__ are not required
  to conform to these specifications. New code should not use
  the obsolescent macro __STDC_IEC_559__ to test for conformance
  to this annex.

This seems inconsistent because 5.2.5.3.3p1 does not require specific
values for __STDC_IEC_60559_BFP__ and __STDC_IEC_559__, while F.1p3
does. Moreover, F.1p3 says "for binary floating-point arithmetic"
while 5.2.5.3.3p1 doesn't.

It seems that the intent was to require that if __STDC_IEC_60559_BFP__
or __STDC_IEC_559__ is defined (i.e. the condition of 5.2.5.3.3p1),
then __STDC_IEC_60559_BFP__ shall be defined to 202311L and
__STDC_IEC_559__ shall be defined to 1, and the implementation shall
conform to the specifications in this annex for binary floating-point
arithmetic.

GCC 15.2.0 defines by default:

#define __STDC__ 1
#define __STDC_VERSION__ 202311L
#define __STDC_IEC_559__ 1
#define __STDC_IEC_60559_BFP__ 201404L

(ditto with Clang 22.1.6 when using -std=c23).

The __STDC_VERSION__ value implies that this is ISO C23, but
the __STDC_IEC_60559_BFP__ value does not correspond to the
one from F.1p3. So, if this is intentional, I'm wondering
what this implies about conformance.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)


More information about the cfp-interest mailing list