compiler wont ignor warnings

Started by
3 comments, last by raptorstrike 19 years, 6 months ago
isnt the compile just sapposed to give you the warnings but compile any way? thats y its a warning not an error right? any way mine isnt doing that im using dev-cpp v.4.9.9.0 c++ how do i change this [smile] thx
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Advertisement
-w

If you do that, don't come back here to complain that your program misbehaves.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
There are occasions when ignoring warnings is warranted. Offhand, I can think of two examples that I have seen: One, the retarded warning that VC++ 6.0 gives about debug symbols being too long (which doesn't provide any useful information and doesn't pertain to anything suspicious in your code), and two, a warning in a program of mine about a conversion that didn't make any sense (in a templated class where strange but harmless things happened with one particular type).

Unless you have any such particular circumstances, however, you should not ignore warnings. They are there for a reason. Personally, I always set my compiler to treat warnings as errors.
I always compile with lots of extra warnings enabled, and the compiler set to treat warnings as errors. It warns you of things for a reason, fix what it's complaining about, or rearrange things so it's clear to you, the compiler, and anyone reading it that is really want you wanted.

I don't use -Weffc++ very often though because it tends to complain about STL, especially about base classes not having virtual destructors. But all the other warnings are pretty useful to have enabled.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
well these warnings are

umm o well it gave me the warnings but it compiled this time! odd ok well i guess thats a rap!
thanks guys
[smile]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

This topic is closed to new replies.

Advertisement