<div dir="ltr">Sorry, I'm not being clear enough. It's nothing to do with runtime libs. Rather it's the result of printing out the expanded literal value directly from the AST. For instance:<div style><ul style>
<li style>Clang parses the <span style="font-family:arial,sans-serif;font-size:13px">DBL_MAX macro into the AST (defined as 1.7976931348623158e+308)</span></li><li style><font face="arial, sans-serif">Pretty printing out the FloatingLiteral results in: </font><span style="font-family:arial,sans-serif;font-size:13px">1.797693134862316E</span><span style="font-family:arial,sans-serif;font-size:13px">+</span><span style="font-family:arial,sans-serif;font-size:13px">308</span></li>
<li style><font face="arial, sans-serif">Feeding these literals back to MSVC results in: error C2177: constant too big</font></li></ul></div><div style>So my question is: Would it be sensible to try and ensure the printed values never exceed their maximums?</div>
<div style><br></div><div style>Cheers,</div><div style>Will.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 16 April 2013 00:56, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><p dir="ltr"><br>
On Apr 16, 2013 8:01 AM, "Will Wilson" <<a href="mailto:will@indefiant.com" target="_blank">will@indefiant.com</a>> wrote:<br>
><br>
> Hi All,<br>
><br>
> I'm rewriting MS C++ code via clang and have an issue involving the printed representations of FLT_MAX and DBL_MAX. In both cases the printed literals exceed the inputs.<br>
><br>
> From MS float.h:<br>
><br>
> #define DBL_MAX         1.7976931348623158e+308<br>
> // Becomes 1.797693134862316E+308<br>
><br>
> #define FLT_MAX         3.402823466e+38F<br>
> // Becomes 3.4028235E+38F<br>
><br>
> Rewriting the values leads to compilation errors due to the literals exceeding their maximums. This doesn't altogether surprise me given the nature of FP arithmetic and string conversion but I was wondering if this could/should be treated as a bug given the significance of these values?</p>


</div></div><p dir="ltr">How are you printing these values out? Libstdc++ or libc++? Does the behavior reproduce under GCC too? I could guess/assume a bug in the standard library implementation you are using, but that's just a guess</p>
<div class="HOEnZb"><div class="h5">

<p dir="ltr">><br>
> - Will.<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
</p>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="background-color:rgb(255,255,255);color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif"><b>Indefiant Ltd.</b></span></div><div>
<font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px"><b><br></b></span></font></div><font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px">Firsby Lodge, New Main Road, Scamblesby, Louth, Lincs LN11 9XH UK<br>
</span></font><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;background-color:rgb(255,255,255)"><span style="color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif;font-size:x-small"><i>Tel: +44 20 8123 7663 England Registered No. 07936820 VAT No. </i></span><span style="background-color:transparent"><font color="#444444" face="Arial, Helvetica, sans-serif" size="1"><i>128556202</i></font></span></div>

</div>