<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 11, 2013 at 1:13 PM, Paul A. Bristow <span dir="ltr"><<a href="mailto:pbristow@hetp.u-net.com" target="_blank">pbristow@hetp.u-net.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-GB"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0mm 0mm 0mm 4.0pt"><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0mm 0mm 0mm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Mehmet Erol Sanliturk<br>
<b>Sent:</b> Sunday, November 10, 2013 3:38 PM<br><b>To:</b> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><b>Subject:</b> [cfe-dev] Integer and Float type definitions with respect to bits number<u></u><u></u></span></p>
</div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>Dears All ,<br><br><br>It seems that , in Clang , there is no a type system like the following :<br><br><br>Integer_8_Bits_Positive <br>
Integer_8_Bits_Signed<br><br><br><br>Integer_16_Bits_Positive <br>Integer_16_Bits_Signed<br><br> <br><br>Integer_32_Bits_Positive <br>Integer_32_Bits_Signed<br><br><br>Integer_64_Bits_Positive <br>Integer_64_Bits_Signed<br>
<br><br><br><br>Float_48_Bits<br>Float_64_Bits<br>Float_80_Bits<br>Float_128_Bits<br><br><br>The following are defined with respect to above types AND Operating System , <br>Processor requirements to enable to compile the SAME sources for different<br>
environments :<br><br>Integer_Default_Bits_Positive <br>Integer_Default_Bits_Signed<br><br>Float_Default_Bits<br><br><br>The existing definitions ( long , long long , etc. ) are very ambiguous and<br>depending on the platform without clearly showing exact bits number . <br>
<br>Is there a possibility to include definitions such as above into Clang<br>or , if there exist such a definition , what is its name ?<br><br><span style="color:#002060">There is a proposal to add *<b>optional</b>* floating-point definitions (adding to existing integer like int32_t) to the next version of the C and C++ standards:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf" target="_blank"><span style="color:#002060">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf</span></a><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060"><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1703.pdf" target="_blank"><span style="color:#002060">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1703.pdf</span></a><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060">This will at least standardise the names of *<b>specified-width</b>* typedefs.<u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:12.0pt">
<span style="color:#002060">Of course some typedefs may require compiler support,<u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060">or a multiprecision library like<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060"><a href="http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/index.html" target="_blank"><span style="color:#002060">http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/index.html</span></a><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060">which now also has experimental cpp_bin_float types<u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060"><a href="https://svn.boost.org/svn/boost/sandbox/multiprecision.cpp_bin_float/" target="_blank"><span style="color:#002060">https://svn.boost.org/svn/boost/sandbox/multiprecision.cpp_bin_float/</span></a></span><span style="color:#7030a0"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060">that can emulate various binary layouts.<u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#002060">HTH<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Paul<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1f497d">---<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1f497d">Paul A. Bristow,<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1f497d">Prizet Farmhouse, Kendal LA8 8AB<span>  </span>UK<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1f497d">+44 1539 561830<span>  </span>07714330204<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1f497d"><a href="mailto:pbristow@hetp.u-net.com" target="_blank">pbristow@hetp.u-net.com</a><u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-bottom:12.0pt"><br><br><br><u></u><br><u></u><u></u><u></u></p>
</div></div></div></blockquote></div><br>Having standard names are important to prevent ambiguity in programs .<br></div><div class="gmail_extra">This is especially important for multiple platform programming ( ( 32-bits , 64-bits ) x ( operating systems , processors ) x different compilers ) and maintaining programs over time : Many years ago , "int" was two-bytes , but now it is very rare , and conversion of such programs are very difficult .<br>
<br></div><div class="gmail_extra">Another problem is occurring in file records : If variable types are not specified by bit-sizes , to use the same file in a file server by different bit-size operating systems are becoming a very difficult or error prone task .<br>
<br></div><div class="gmail_extra">To solve such problems , it is important to have variable kinds specified by bit-numbers .<br><br><br></div><div class="gmail_extra">To supply such definitions in compiler libraries is a more lasting and error-free approach for the users . Over time , missing parts may be completed with new bit-sized type definitions instead of definitions like ( long .. , long long ... , long long long ... ) .<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you very much .<br><br></div><div class="gmail_extra">Mehmet Erol Sanliturk<br><br><br> <br></div><div class="gmail_extra"><br></div></div>