Clarify the specification of the width macros

Jens Gustedt, INRIA and ICube, France

2024年12月01日

target

integration into IS ISO/IEC 9899:202y

document history

document number date comment
n3413 202412 Original proposal

license

CC BY, see https://creativecommons.org/licenses/by/4.0

1 Motivation

The current wording in 5.3.5.3.2 has lead to misunderstandings, in particular it had not been clear to implementations that the provided values are further constrained later by specific properties of certain integer types, in particular for bool. We propose to clarify this by making it explicit how the properties (width) and the macros (_WIDTH) relate.

2 Suggested changes to the wording.

New text is (追記) underlined green (追記ここまで), removed text is (削除) stroke-out red (削除ここまで).

5.3.5.3.2 Characteristics of integer types <limits.h> (追記) and <stdint.h> (追記ここまで)

1 (追記) Each integer type (6.2.5) that is defined by this document and that is not a bit-precise integer type has a corresponding width macro with a name ending in _WIDTH. The values of these macros provide the number of bits in the value representation of the type (6.2.6.2). (追記ここまで) The values given subsequently shall be replaced by constant expressions suitable for use in conditional expression inclusion preprocessing directives. (削除) Their implementation-defined values (削除ここまで) (追記) Those of the values that are implementation-defined (追記ここまで) shall be equal or greater to those shown(追記) ; otherwise the values shall be exact (追記ここまで).

Aknowledgements

Thanks to Aaron Ballman for discussion and feedback.

AltStyle によって変換されたページ (->オリジナル) /