<html><body><p><font size="2" face="sans-serif">Here are some words for both alternatives listed in CFP 2085 (attached) below.</font><br><font size="2" face="sans-serif">Note that the words for alternative (1) can be further specified in terms of actual changes to all the specification for the contents of the headers that we now allow in fenv.h and math.h and stdlib,h, but I think that would reduce clarity and be more fragile and prone to error. Hence a minimal change is proposed alone.</font><br><br><br><font size="2" face="sans-serif">For alternative (1), in N2596, change Section 4#7 from:</font><br><br><font size="2" face="sans-serif">The strictly conforming programs that shall be accepted by a conforming freestanding implementation that defines __STDC_IEC_60559_BFP__ or __STDC_IEC_60559_DFP__ may also use features in the contents of the standard headers <fenv.h> and <math.h> and the numeric conversion functions (7.22.1) of the standard header <stdlib.h>. All identifiers that are reserved when <stdlib.h> is included in a hosted implementation are reserved when it is included in a freestanding implementation.</font><br><br><font size="2" face="sans-serif">to:</font><br><br><font size="2" face="sans-serif">The strictly conforming programs that shall be accepted by a conforming freestanding implementation that defines __STDC_IEC_60559_BFP__ or __STDC_IEC_60559_DFP__ may also use features in the contents of the standard headers <fenv.h> and <math.h> and the numeric conversion functions (7.22.1) of the standard header <stdlib.h> </font><br><font size="2" color="#0000FF" face="sans-serif"><b>  without the requirements to set errno (see 7.5), or modify the floating point environment (see 7.6)</b></font><br><font size="2" face="sans-serif">. All identifiers that are reserved when <stdlib.h> is included in a hosted implementation are reserved when it is included in a freestanding implementation.</font><br><br><br><font size="2" face="sans-serif">For alternative (2), in N2596, change 7.22.1.5#10 (and similar changes for the rest of the family of functions) from:</font><br><br><font size="2" face="sans-serif">The functions return the converted value, if any. If no conversion could be performed, zero is returned. If the correct value overflows and default rounding is in effect (7.12.1), plus or minus HUGE_VAL, HUGE_VALF, or HUGE_VALL is returned (according to the return type and sign of the value), and the value of the macro ERANGE is stored in errno. If the result underflows (7.12.1), the functions return a value whose magnitude is no greater than the smallest normalized positive number in the return type; whether errno acquires the value ERANGE is implementation-defined.</font><br><br><font size="2" face="sans-serif">to:</font><br><br><font size="2" face="sans-serif">The functions return the converted value, if any. If no conversion could be performed, zero is returned. If the correct value overflows and default rounding is in effect (7.12.1), plus or minus HUGE_VAL, HUGE_VALF, or HUGE_VALL is returned (according to the return type and sign of the value), and the value of the macro ERANGE is stored in errno</font><br><font size="2" color="#0000FF" face="sans-serif"><b>  if the integer expression math_errhandling & MATH_ERRNO is nonzero. If the integer expression math_errhandling & MATH_ERREXCEPT is nonzero, the "overflow" floating-point exception is raised.</b></font><br><font size="2" face="sans-serif"> If the result underflows (7.12.1), the functions return a value whose magnitude is no greater than the smallest normalized positive number in the return type; whether errno acquires the value ERANGE </font><br><font size="2" color="#0000FF" face="sans-serif"><b>  if the integer expression math_errhandling & MATH_ERRNO is nonzero is implementation defined. If the integer expression math_errhandling & MATH_ERREXCEPT is nonzero, whether the "underflow" floating-point exception is raised </b></font><br><font size="2" face="sans-serif">is implementation-defined.</font><br><br><font size="2" face="sans-serif">Regards,<br><br></font><font size="2" face="sans-serif"><b>Rajan Bhakta</b></font><font size="2" face="sans-serif"><br>z/OS XL C/C++ Compiler Technical Architect<br>ISO C Standards Representative (Canada, USA), PL22.11 Chair<br>C/C++ Compiler Development</font><br><font size="2" face="sans-serif">rbhakta@us.ibm.com</font><br><br><font size="2" face="sans-serif">IBM</font><br><br><img width="16" height="16" src="cid:1__=8FBB0DC0DFC661E88f9e8a93df938690@ibm.com" border="0" alt="Inactive hide details for "Rajan Bhakta" ---08/05/2021 02:19:59 PM---Looking at the specification, I think the only thing that "><font size="2" color="#424282" face="sans-serif">"Rajan Bhakta" ---08/05/2021 02:19:59 PM---Looking at the specification, I think the only thing that really works is to do something like the f</font><br><br><font size="1" color="#5F5F5F" face="sans-serif">From:        </font><font size="1" face="sans-serif">"Rajan Bhakta" <rbhakta@us.ibm.com></font><br><font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">cfp-interest@oakapple.net</font><br><font size="1" color="#5F5F5F" face="sans-serif">Date:        </font><font size="1" face="sans-serif">08/05/2021 02:19 PM</font><br><font size="1" color="#5F5F5F" face="sans-serif">Subject:        </font><font size="1" face="sans-serif">[EXTERNAL] [Cfp-interest 2085] Freestanding with FP binding</font><br><font size="1" color="#5F5F5F" face="sans-serif">Sent by:        </font><font size="1" face="sans-serif">"Cfp-interest" <cfp-interest-bounces@oakapple.net></font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><font size="1" color="#FFFFFF" face="serif">Looking at the specification, I think the only thing that really works is to do something like the following: 1) Say for freestanding that error conditions do not necessarily have to be handled (including setting errno). This would have the ZjQcmQRYFpfptBannerStart</font><font size="3" face="serif"> </font><br><font size="2" face="Arial"><b>This Message Is From an External Sender </b></font><br><font size="1" face="Arial">This message came from outside your organization. </font><br><font size="1" color="#FFFFFF" face="serif">ZjQcmQRYFpfptBannerEnd</font><p><font size="2" face="sans-serif">Looking at the specification, I think the only thing that really works is to do something like the following:<br>1) Say for freestanding that error conditions do not necessarily have to be handled (including setting errno). This would have the new side effect of not requiring using exceptions as well.<br>or<br>2) Change the strtod family of functions to allow exceptions to be used for error reporting instead of just errno. This would be a change to the general C standard, but likely more palatable.</font><font size="3" face="serif"><br></font><font size="2" face="sans-serif"><br>With regards to the whitespace and decimal point scanning, as long as we allow a freestanding implementation to have just the C locale (as it is now) and a single fixed code page, I think it would work for freestanding. The issues described in WG14 19444 still apply however meaning the code is not necessarily portable, but this may be something we either accept, or mandate that the C locale must be used.</font><font size="3" face="serif"><br></font><font size="2" face="sans-serif"><br>Regards,<br></font><font size="2" face="sans-serif"><b><br>Rajan Bhakta</b></font><font size="2" face="sans-serif"><br>z/OS XL C/C++ Compiler Technical Architect<br>ISO C Standards Representative (Canada, USA), PL22.11 Chair<br>C/C++ Compiler Development<br>rbhakta@us.ibm.com</font><font size="3" face="serif"><br></font><font size="2" face="sans-serif"><br>IBM</font><font size="3" face="serif"><br></font><tt><font size="2">_______________________________________________<br>Cfp-interest mailing list<br>Cfp-interest@oakapple.net<br></font></tt><tt><font size="2"><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest">http://mailman.oakapple.net/mailman/listinfo/cfp-interest</a></font></tt><tt><font size="2"> <br></font></tt><p><p><BR>
<BR>
</body></html>