<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I don't believe this response from Joseph was sent to CFP. Those with compiler expertise, please look at it carefully. We want calls to standard library functions to be affected by constant rounding direction modes. We want to specify that the dynamic rounding mode will be in effect where the compiler can't reasonably know if the function to be called will be a standard library function - assuming there's a clean enough way to distinguish such cases.<div><br></div><div>-Jim&nbsp;<div><br></div><div><br><div><div><div>On Jan 30, 2012, at 8:46 AM, Jim Thomas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>From: </b></span><span style="font-family:'Helvetica'; font-size:medium;">"Joseph S. Myers" &lt;<a href="mailto:jsm@polyomino.org.uk">jsm@polyomino.org.uk</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>(SC22WG14.12592) [Cfp-interest] [Fwd: Comments on N1591 (binary floating point)]</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">January 24, 2012 11:09:37 AM PST<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(127, 127, 127, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">wg14 &lt;<a href="mailto:sc22wg14@open-std.org">sc22wg14@open-std.org</a>&gt;<br></span></div><br><br>On Tue, 24 Jan 2012, Jim Thomas wrote:<br><br><blockquote type="cite"><blockquote type="cite">(b) The constant rounding modes specification (7.6.2) refers to "Any call<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">made through a function pointer". &nbsp;The semantics specified by the C<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">standard are that *all* calls to a function (as opposed to a macro) are<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">through a function pointer; the function designator is converted,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">explicitly or implicitly, to pointer to function type, before it is used<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">in a call.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Please provide a reference for the C standard specification.<br></blockquote><br>6.3.2.1 paragraph 4: "A function designator is an expression that has <br>function type. Except when it is the operand of the sizeof operator, the <br>_Alignof operator, or the unary &amp; operator, a function designator with <br>type ``function returning type'' is converted to an expression that has <br>type ``pointer to function returning type''."<br><br>As noted in the footnote, "Because this conversion does not occur, the <br>operand of the sizeof or _Alignof operator remains a function designator <br>and violates the constraints in 6.5.3.4.". &nbsp;6.5.3.2 paragraph 3 deals with <br>unary &amp;. &nbsp;So in every case of valid code, a function designator is <br>converted to a pointer to function, whether by 6.3.2.1 paragraph 4 or by <br>explicit unary &amp;. &nbsp;Function calls are then defined in 6.5.2.2 paragraph 1 <br>with "The expression that denotes the called function shall have type <br>pointer to function returning void or returning a complete object type <br>other than an array type." and a footnote "Most often, this is the result <br>of converting an identifier that is a function designator.".<br><br>So all function calls go via a function pointer in the standard semantics. &nbsp;<br>f(), (f)(), (((f)))(), ((&amp;((f))))() all involve a single conversion from <br>function designator to function pointer; (*f)(), for example, involves two <br>such conversions (the function designator f is converted implicitly to a <br>function pointer, the unary * converts it back to a function designator, <br>(*f) is still a function designator (as per the rules on parentheses, <br>6.5.1 paragraph 5) which then gets converted implicitly to a function <br>pointer for the call).<br><br>-- <br>Joseph S. Myers<br><a href="mailto:jsm@polyomino.org.uk">jsm@polyomino.org.uk</a><br><br><br><br><br></blockquote></div><br></div></div></div></body></html>