T
Tim Rentsch
Noob said:Do you have an example?
Unfortunately all I have is a memory of seeing it
happen, not a specific example. Probably something
related to -Wsign-compare, but I'm not sure of that.
Noob said:Do you have an example?
There are areas of the world in which "doubt" is used exactly as
Americans and Europeans use "question". This was one of the things I
had to get used to when I started having significant numbers of students
from India.
Seebs said:After thinking about this for a long time, I've concluded that it's worth
pointing out the confusion to people, because there are a lot of
circumstances in which substituting "doubt" for "question" has a significant
chance of insulting people. Replacing "I don't understand that" with "I think
you are lying to me" is not a harmless change.
Jorgen Grahn said:Jorgen Grahn said:On Thu, 2013-04-11, Tim Rentsch wrote:
On Tue, 2013-04-02, Tim Rentsch wrote:
Yep it did give warning. Thnx for pointing the correct gcc option for
correct ansi parsing.
You may also want to try
gcc -std=c99 -pedantic-errors
...
gcc -std=c11 -pedantic-errors
I strongly recommend
-std=something -Wall -Wextra -pedantic -O2
[snip elaboration]
This part of the elaboration is important:
It's a good start for new code [...]
Yes, my snipping here was a bit overzealous. Sorry about that.
However, that qualifier doesn't lessen my reaction -- if anything
it intensifies it. Using -Wall and -Wextra on new code is the
worst place to use them, because that's where they are most
likely to nudge people into bad habits, or cause problems later.
It is much better to use -Wall/-Wextra sparingly, on source code
that is more mature, as an independent sanity check or quality
assessment step. Using -Wall or -Wextra on a regular basis,
especially as a default for new code, is IMO a bad practice and
one likely to lead to poor coding habits.
I didn't intend to suggest the flags above as the universal
solution to all problems.
Certainly that was not my impression, and I hope my comments
didn't suggest otherwise.
Ok, good. But we're still on opposide sides: IMO -Wall,
-Wextra and -pedantic lead to *good* habits in the usual case.
(There's one class of warnings I would agree are problematic,
and that's the ones for unused static functions, parameters and
variables. Useful, but when they don't alert you to an actual
bug, it's often hard to do anything about them without making
the code worse. And yes, I refuse to do that just to please
the compiler.)
Others will have to make up their own minds, I guess.
Noob said:Do you have an example?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.