It's essential to follow pjmlp's advice, since C does otherwise not give a lot of feedback about one's mistakes: learning from one's mistakes might take a long time since a quite broken program (think overwriting past memory strictly allocated for one entity) might still lead to a working program.
Use your compiler, use it well with all its warnings. Run your programs under valgrind or some such.
Nice suggestion. Although I can't seem where one would have to look for those "pretty colours" you mentioned, I certainly can't see any of them on my Mac terminal...
"-Weverything" if the code is compiling perfectly, but you're just bored. If you're not a complete masochist try turning off some of the sillier ones (-Wno-padded -Wno-unused-parameter -Wno-conversion)
Absolutely, but my way of going about this would be to first show _why_ something is a best practice, rather than forcing people to take it at face value.
A more conservative rule would be not to use C where security is a concern, unless you know what you're doing.
When you're writing the kind of software that's an invitation to hackers, like a web application, you should favor a language like PHP or Ruby, which takes things like buffer overflows out of the equation, and even then, you should know what you're doing.
> A more conservative rule would be not to use C where security is a concern, unless you know what you're doing.
Which if you follow my posts, you will see that I defend C and C++ should be replaced by safer systems programming languages, that exist since Modula-2 days.
Having said this, C and C++ are still used everywhere and will outlive most of us.
So when using them, for whatever reasons, at least one should take care to use the best practices regarding how to write secure and safe code in those languages.