Skip to content

Format specifier for write procedure with type real

In clause 5.2.6, last paragraph, the LRM states:

For the operation with the FORMAT parameter, the format of the result is determined using the value of the FORMAT parameter in the manner described in ISO/IEC 8859-1:1998, ISO/IEC 9899:2018 for the C fprintf function. A model is erroneous if it calls the operation with a value for the FORMAT parameter that is other than a conversion specification in which the conversion specifier is one of e, E, f, F, g, G, a, or A. Moreover, the model is erroneous if the conversion specification contains a length modifier or uses an asterisk for the field width or precision. An implementation shall support use of the conversion specifiers e, E, f, g, and G, and may additionally support use of the conversion specifiers F, a, and A. A model is erroneous if it calls the operation with a value for the FORMAT parameter that is a conversion specification in which the conversion specifier is one of F, a, or A and the implementation does not support use of the conversion specifier. The values of FLT_RADIX and DECIMAL_DIG (described in ISO/IEC 8859-1:1998, ISO/IEC 9899:2018) are implementation defined.

First, why is 8859-1 referenced, it is the latin character set. What is it's relevance here other than type character is based on it? I am thinking that ISO/IEC 9899:2018 is sufficient. Hence, it needs to be updated as follows:

For the operation with the FORMAT parameter, the format of the result is determined using the value of the FORMAT parameter in the manner described in ISO/IEC 8859-1:1998, ISO/IEC 9899:2018 for the C fprintf function. A model is erroneous if it calls the operation with a value for the FORMAT parameter that is other than a conversion specification in which the conversion specifier is one of e, E, f, F, g, G, a, or A. Moreover, the model is erroneous if the conversion specification contains a length modifier or uses an asterisk for the field width or precision. An implementation shall support use of the conversion specifiers e, E, f, g, and G, and may additionally support use of the conversion specifiers F, a, and A. A model is erroneous if it calls the operation with a value for the FORMAT parameter that is a conversion specification in which the conversion specifier is one of F, a, or A and the implementation does not support use of the conversion specifier. The values of FLT_RADIX and DECIMAL_DIG (described in ISO/IEC 8859-1:1998, ISO/IEC 9899:2018) are implementation defined.

It may be nice to clean up the conciseness of the text, but I am not sure that that actually adds any value, so I suspect we should leave the rest it as it is.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information