Message ID | alpine.LNX.2.00.1210040043510.1878@tuna.site |
---|---|
State | New |
Headers | show |
On Thu, Oct 4, 2012 at 12:03 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote: > Running `make test` on my nightly testers I noticed the following > in the log files: > > cc1: warnings being treated as errors > /scratch/tmp/gerald/gcc-HEAD/libbacktrace/btest.c: In function 'f23': > /scratch/tmp/gerald/gcc-HEAD/libbacktrace/btest.c:476: warning: 'expected' may be used uninitialized in this function > gmake[3]: *** [btest-btest.o] Error 1 > gmake[3]: Target `btest' not remade because of errors. > > Doesn't this mean that effectively the test is not executed? I don't think so, not sure what you are getting at here. I'm not sure why I even wrote "case 3:", j can never take on the value 3. > 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com> > > * btest.c (f23): Avoid uninitialized variable warning. This is OK. Thanks. Ian
On Thu, 4 Oct 2012, Ian Lance Taylor wrote: >> cc1: warnings being treated as errors >> /scratch/tmp/gerald/gcc-HEAD/libbacktrace/btest.c: In function 'f23': >> /scratch/tmp/gerald/gcc-HEAD/libbacktrace/btest.c:476: warning: 'expected' may be used uninitialized in this function >> gmake[3]: *** [btest-btest.o] Error 1 >> gmake[3]: Target `btest' not remade because of errors. >> >> Doesn't this mean that effectively the test is not executed? > I don't think so, not sure what you are getting at here. With "warnings being treated as error" the warning lead to "btest-btest.o] Error 1" and so I thought the build did not actually go through. Anyway, after my patch this is now gone. :-) Thanks for the quick review! Gerald
Index: btest.c =================================================================== --- btest.c (revision 192086) +++ btest.c (working copy) @@ -486,7 +486,7 @@ case 2: expected = "test3"; break; - case 3: + default: assert (0); }