Hi, I noticed today that we actually currently just warn and not error out while compiling GCC for uninitialized warnings. While doing a build I got the following warning: /src/gcc/local/gcc/gcc/cp/pt.c: In function 'subst_copy': /src/gcc/local/gcc/gcc/cp/pt.c:9919: warning: 'len' may be used uninitialized in this function
I looked into the code and could not figure out how to fix it as I don't understand how variable argument templates should work here. I also looked to figure out how to fix this so we get an error next time and made this patch: Index: gcc/system.h =================================================================== --- gcc/system.h (revision 133718) +++ gcc/system.h (working copy) @@ -802,7 +802,7 @@ extern void fancy_abort (const char *, i #pragma GCC diagnostic warning "-Wcast-qual" /* If asserts are disabled, activate -Wuninitialized as a warning (not an error/-Werror). */ -#ifndef ASSERT_CHECKING +#ifndef ENABLE_ASSERT_CHECKING #pragma GCC diagnostic warning "-Wuninitialized" #endif #endif Hopefully someone can look into the warning and fix it and also apply the patch to system.h after the warning has been fixed. Thanks, Andrew Pinski