Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Giving a program priority briefly



On 12/06/07, Darren Cook <darren@example.com> wrote:

> Improved tip of the day, use -Wall in g[+c]{2}.

Or in other words, use "-Wall -Wshadow"

Despite the name, -Wall does not do "all" warnings, in fact only about
half of the available ones:
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Warning-Options.html#Warning-Options

Interesting. It seems like -Wshadow at least used to be included in -Wall, because I *know* I've seen the warning before. But you are certainly right now:


: jglover@example.com; cat tmp/test-shadow.c int main (void) { int i = 0;

 if (1) {
   int i = 1;

   i++;
 }

 i--;

 return 0;
}
: jglover@example.com; gcc -Wall tmp/test-shadow.c
: jglover@example.com; gcc -Wall -Wshadow tmp/test-shadow.c
tmp/test-shadow.c: In function 'main':
tmp/test-shadow.c:5: warning: declaration of 'i' shadows a previous local
tmp/test-shadow.c:2: warning: shadowed declaration is here


Cheers, Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links