[cfe-dev] catching assignment size mismatch errors

John McCall rjmccall at apple.com
Thu Nov 1 12:47:26 PDT 2012


On Nov 1, 2012, at 11:18 AM, Sudhindra Deshpande wrote:
> How do I catch truncation errors like this:
>     unsigned short v1 = 0;
>     unsigned int v2 = 0;
>     v2 = 2000;
>     v1 = v2;

-Wconversion will warn about any sort of implicit conversion that
discards precision or range.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121101/a8b55875/attachment.html>


More information about the cfe-dev mailing list