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

miroslav.fontan miroslav.fontan at wincor-nixdorf.cz
Mon Jan 20 06:28:22 PST 2014


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





More information about the cfe-dev mailing list