[cfe-dev] A need for an "-fsanitize=integer-assign-overflow"

David Blaikie dblaikie at gmail.com
Mon Jan 20 10:36:35 PST 2014

In theory something like UBSan (-fsanitize=undefined) or the Integer
sanitizer (-fsanitize=integer) should help catch this at runtime, but I
can't seem to get them to fire on this code. Not sure if it's a missing
feature/bug or some necessary false negative.

On Mon, Jan 20, 2014 at 6:28 AM, miroslav.fontan <
miroslav.fontan at wincor-nixdorf.cz> wrote:

> Hi all,
> I would like to ask whether it is possible to turn an integer sanitizer to
> capture integer overflows in an assignment statement
> int32_t i32 = INT32_MAX;
> int16_t i16 = i32; // runtime warning "integer assignment overflow" would
> be
> fine
> I know there is a flag -Wconversion and the code should compile cleanly
> with
> -Wconversion -Werror. At this point it is impossible to clean the entire
> code base, I need to first find the most critical parts and to start
> cleaning the code from there
> Regards
> ---
> Mira
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140120/ff7a1165/attachment.html>

More information about the cfe-dev mailing list