Mailing List Archive


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

Re: [tlug] Giving a program priority briefly



On 6/12/07, Darren Cook <darren@example.com> wrote:
>> *: Even something as trivial as renaming a parameter can cause very
>> subtle bugs if the parameter name was also the name of a variable in one
>> of the base classes. Tip of the day: use -Wshadow in g++.
>
> 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

Scroll down to -Wall; everything below that is not included.


For a program I wrote with only 3000 lines, -Wall gave ZERO warning but when I checked it with lint[1], I got more than 3200 warnings :D.

lint is a really good tool for UT and code review FYI

[1] http://www.google.co.jp/search?hl=ja&q=lint&lr=

# and Jlint for Java programmers

--
Best Regards,
Nguyen Hung Vu
vuhung16plus{remove}@example.com
An inquisitive look at Harajuku
http://www.flickr.com/photos/vuhung/sets/72157600109218238/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links