lkml.org 
[lkml]   [2005]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.14 assorted warnings
Alan Cox writes:

> gcc is a *LOT* smarter than you give it credit for. It will not warn for
> cases where it isn't able to tell how foo is used passed with &foo. It
> will warn for cases where it can

Gcc thinks it is a lot smarter than it actually is, in fact. :)

The usual case where it gives a bogus warning is where the value of
one variable is correlated with the defined-ness of another, for
example:

found = 0;
for (i = 0; i < N; ++i) {
if (a[i] == foo) {
x = b[i];
found = 1;
break;
}
}
if (found)
bar(x);

Gcc will warn on the use of x when in fact it is perfectly OK, and we
get quite a few of these in compiling a kernel. At a minimum, I would
like to be able to disable the "may be used uninitialized" warnings
while still getting the "is used uninitialized" warnings.

Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-31 01:56    [W:1.582 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site