So, given the following code:
int main(void) {
int i;
i = 12.1234;
i++;
return 0;
}
I compiled the code and I expected and wanted t
You may expect that -Wall does enable ALL warnings, but it doesn't!
There are a lot of warnings that doesn't even make sense in the wrong environment.
It is an aggregation of the following flags:
-Waddress -Warray-bounds (only with -O2) -Wc++11-compat -Wchar-subscripts -Wenum-compare (in C/ObjC; this is on by default in C++) -Wimplicit-int (C and Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) -Wcomment -Wformat -Wmain (only for C/ObjC and unless -ffreestanding) -Wmaybe-uninitialized -Wmissing-braces (only for C/ObjC) -Wnonnull -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare (only in C++) -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-varas described here: https://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Warning-Options.html
What you need is -Wconversion as mentioned above. Another quite useful flag may be -Wextra.