[cfe-dev] A need for an "-fsanitize=integer-assign-overflow"
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
> I know there is a flag -Wconversion and the code should compile cleanly
> -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
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev