by userbinator · 11y ago · 0 comments
int foo() {
int bar;
return bar + 5; /* C4700: local variable 'bar' used without having been initialized */
}
https://msdn.microsoft.com/en-us/library/axhfhh6x.aspxIn the same situation, GCC says "may be used uninitialized in this function" if you enable the warning (-Wmaybe-uninitialized), despite this being a trivial and certain case.
Maybe you are using a old version.
If you enable -Wall which you always should then this flag is automatically enabled.
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#inde...