<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></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;">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>Subject: </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>data-interchange and scalar types</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 11, 2013 4:30:15 PM PDT<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;">"Joseph S. Meyers" &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>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><br>On Mar 7, 2013, at 11:53 AM, Jim Thomas &lt;<a href="mailto:jaswthomas@sbcglobal.net">jaswthomas@sbcglobal.net</a>&gt; wrote:<br><br>…<br><br><blockquote type="cite"><br>On Mar 6, 2013, at 2:36 PM, Joseph S. Myers &lt;<a href="mailto:jsm@polyomino.org.uk">jsm@polyomino.org.uk</a>&gt; wrote:<br><br><blockquote type="cite">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;<br></blockquote><br>Right - such data-interchange types are not arithmetic types or floating types.<br><br><blockquote type="cite">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></blockquote><br>Good issue. I don't think we want data-interchange types to be scalar types. We can try including data-interchange types just where needed. For example, for casts we could change 6.2.5 to:<br><br>…<br>[2] <span class="Apple-tab-span" style="white-space:pre">        </span>Unless the type name specifies a void type, the type name shall specify atomic, qualified, or unqualified scalar or data-interchange type, and the operand shall have scalar or data-interchange type.<br>…<br>[4]<span class="Apple-tab-span" style="white-space:pre">        </span>A pointer type shall not be converted to any floating or data-interchange type. A floating or data-interchange type shall not be converted to any pointer type.<br>…<br><br></blockquote><br>…<br><br>After further consideration, I think we do want data-interchange types to be scalar types. This fits with the general meaning of scalar as non-composite, and it requires fewer changes to the C standard (and avoids changes in the memory and atomics clauses). <br><br>So we'd have "Arithmetic types, data-interchange types, and pointer types are collectively called scalar types." And in a few places, for example in 6.5.13 Constraints, we'd need to change "scalar" to "arithmetic or pointer" to exclude data-interchange.<br><br>-Jim Thomas<br><br><br><br></div></blockquote></div><br></body></html>