<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 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(0, 0, 0, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Re: (SC22WG14.12843) CFP teleconference, documents</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(0, 0, 0, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica'; font-size:medium;">March 6, 2013 2:36:05 PM 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(0, 0, 0, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica'; font-size:medium;">Jim Thomas &lt;<a href="mailto:jaswthomas@sbcglobal.net">jaswthomas@sbcglobal.net</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(0, 0, 0, 1.0);"><b>Cc: </b></span><span style="font-family:'Helvetica'; font-size:medium;">SC22 WG14 &lt;<a href="mailto:sc22wg14@open-std.org">sc22wg14@open-std.org</a>&gt;<br></span></div><br><div>Some comments on the part 3 document (interchange and extended types, <br>N1680) (page numbers are those printed on the pages):<br><br><br>Types (pages 3-5):<br><br>Is a data interchange type on which not all operations are supported an <br>arithmetic type or a floating type? &nbsp;Presumably not, because the <br>definitions of "floating types" (C11 6.2.5#11) and "arithmetic types (#18) <br>still apply. &nbsp;So which operations are supported for such a type can be <br>determined by the existing wording in C11, together with the addition text <br>this document adds regarding conversions. &nbsp;But there are some issues for <br>which this isn't sufficient:<br><br>* Is such a type a scalar type? &nbsp;To meet the constraints for casts, for <br>example (6.5.4#2), it appears these types should be scalar types, and the <br>wording added as 6.3.2.3a (page 8) certainly suggests conversions <br>involving such types should be allowed. &nbsp;Similarly, the wording about <br>sequencing of side-effects (6.5#2) is something that ought to apply to <br>such types; likewise the wording on initializers for scalars (6.7.9#11). &nbsp;<br>But I don't see any change to the definition of scalar types (6.2.5#21) to <br>include data interchange types that are not arithmetic types.<br><br>* However, several places assume that scalars can be compared with 0 <br>(unary !, &amp;&amp;, ||, ?:, selection and iteration statements, assert macro). &nbsp;<br>So if you do make these types scalar types, then you need either to allow <br>such comparisons for them (given that such types, not being arithmetic, do <br>*not* meet the constraints for == and !=), or make exceptions in those <br>places.<br><br>* The rules for default static initialization (6.7.9#10) cover pointers, <br>arithmetic types, aggregates and unions. &nbsp;So with such a type not being <br>arithmetic, you need to define static initialization, presumably to <br>positive zero.<br><br>Then there are some other issues where the definition of both data <br>interchange types (whether or not interchange floating types) and extended <br>floating types is incomplete:<br><br>* Where are the syntax additions for the new types? &nbsp;Should _FloatN, <br>_FloatNx, _DecimalN, _DecimalNx, for values of N supported by the <br>implementation, be keywords added to the list in 6.4.1#1? &nbsp;They certainly <br>need to be matched by the type-specifier syntax (6.7.2#1). &nbsp;And <br>appropriate combinations of specifiers (allowing _Complex or _Imaginary) <br>need to be added to the list of valid combinations in 6.7.2#2.<br><br>* I'm not sure of the logic of supporting _Complex only with interchange <br>floating types; should implementations be permitted also to support it <br>with (binary) data interchange types that aren't interchange floating <br>types, and with (binary) extended floating types? &nbsp;Likewise _Imaginary.<br><br>* There are references to such things as _Float32 being equivalent to <br>float. &nbsp;What does "equivalent" mean here? &nbsp;The types could be the same <br>type (like "long" and "long int"). &nbsp;They could be compatible types (like <br>"int" and an enum for which the implementation-defined compatible integer <br>type is int), but not the same. &nbsp;They could be distinct (like "char" and <br>"unsigned char", even if char is unsigned) but have the same <br>representation and alignment. &nbsp;Or one might imagine float having one <br>endianness and _Float32 the other (both being binary32); is that intended <br>to be ruled out?<br><br>If various possibilities for whether types are the same / compatible / <br>distinct but with the same values and (apart maybe from bit ordering) <br>representation are intended to be allowed, I think the TS should make <br>clear exactly what possibilities are permitted, rather than just using a <br>vague "equivalent".<br><br>* The default argument promotions promote float to double when passed in <br>variable arguments (6.5.2.2#6). &nbsp;Is such promotion permitted or required <br>for _Float32 (clearly it is if _Float32 is actually the same type as <br>float)? &nbsp;What about for _Float16? &nbsp;An application wishing to retrieve such <br>a value with va_arg needs to know the promoted type, since va_arg must be <br>called with the promoted type name (C11 7.16.1.1#2).<br><br>* Are all the new types basic / fundamental types, so that malloc must <br>return memory suitably aligned for them (see my reflector message 12832 on <br>9 Jan for more on the issues there)? &nbsp;C11 6.2.5#14 says "The type char, <br>the signed and unsigned integer types, and the floating types are <br>collectively called the basic types.", leaving open the question of <br>whether data interchange types are also basic types.<br><br><br>Characteristics (pages 5-7):<br><br>* Must the value of DECIMAL_DIG be correct for all the new _FloatN and <br>_FloatNx types (floating integer types and extended floating types, not <br>ones that are only data interchange types), or just for float, double and <br>long double?<br><br><br>Conversions (pages 7-8):<br><br>* You say "Otherwise, if both operands are floating types and the sets of <br>values of their corresponding real types are equivalent, no further <br>conversion is needed.". &nbsp;That is, the resulting type is left unspecified <br>if for example the operands are float and _Float32 but those are distinct <br>types. &nbsp;I'd think it would be better to follow the practice for integer <br>types, where if two types have the same values the result is determined by <br>integer conversion rank, and require an implementation-defined total order <br>on real floating types with the same set of values (or completely define <br>such an order in this document rather than leaving it <br>implementation-defined).<br><br><br>Mathematics &lt;math.h&gt; (pages 9-18):<br><br>* If an implementation doesn't support _Float128, say, are the function <br>and macro names associated with it still reserved for the implementation? &nbsp;<br>I'd say that they should be (and much the same applies to &lt;float.h&gt; macros <br>when &lt;float.h&gt; is included) - that might facilitate, for example, <br>implementations with full support for _Float32 and _Float64 but only <br>partial _Float128 support. &nbsp;So it should be made clear what is reserved. &nbsp;<br>(I'd guess acosf256 is reserved but not acosf257, because of the rules on <br>which N have a _FloatN format defined.)<br><br>* The statement on page 10 about SNANFN and SNANDN macros appears to be <br>the first use of the term "interface type". &nbsp;This should probably be "data <br>interchange type". &nbsp;But then for FP_FAST_FMAMFN and FP_FAST_FMADN you <br>introduce "interface floating type" - I guess this should be "interchange <br>floating type".<br><br><br>Numeric conversion functions &lt;stdlib.h&gt; (pages 18-19):<br><br>* There are two references to __STDC_WANT_IEC_00000_EXT3__ that should use <br>the 18661 number.<br><br>* Should there be wide-string analogues of these conversion functions <br>(analogues of wcstod / swprintf_s for the new types)?<br><br><br>Other:<br><br>* You define some new complex types, but no associated &lt;complex.h&gt; <br>functions. &nbsp;Should names for such functions such as cacosfN at least be <br>reserved to the implementation? &nbsp;(And likewise for the future library <br>directions &lt;complex.h&gt; functions listed in 7.31.1#1.)<br><br>* Should &lt;tgmath.h&gt; be required to handle the new interchange floating <br>types and extended floating types? &nbsp;(At least for real arguments, if you <br>don't define corresponding complex functions for the new types.) &nbsp;<br>Certainly part 2 extends it to cover decimal types.<br><br>-- <br>Joseph S. Myers<br><a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a><br></div></blockquote></div><br></body></html>