<p dir="ltr">Sure, that works for me.</p>
<div class="gmail_quote">On 27 Oct 2013 11:28, "JF Bastien" <<a href="mailto:jfb@google.com">jfb@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> It'd be nice to test that the values are actually correct, as well as that<br>
> they are in matching pairs. Something like:<br>
><br>
> (unsigned char)SCHAR_MIN == (unsigned char)SCHAR_MAX + 1<br>
><br>
> ... should do the trick.<br>
<br>
How about:<br>
<br>
_Static_assert(SCHAR_MAX == UCHAR_MAX/2, "");<br>
_Static_assert(SHRT_MAX == USHRT_MAX/2, "");<br>
_Static_assert(INT_MAX == UINT_MAX/2, "");<br>
_Static_assert(LONG_MAX == ULONG_MAX/2, "");<br>
<br>
Matched pairs make sure signed min/max are consistent, unsigned max<br>
are correct by casting all-ones, and the four I propose make sure<br>
signed max is correct.<br>
<br>
> Maybe:<br>
><br>
> #else<br>
><br>
> int LLONG_MIN, LLONG_MAX, ULLONG_MAX; // not defined<br>
<br>
Done.<br>
</blockquote></div>