Using -Wextra
It may be a sign of masochism, but I like finding new ways to break software builds. A recent article by one of the LLVM developers had this gem:
While some developers are disciplined and build with "-Wall -Wextra" (for example), many people don't know about these flags or don't bother to pass them. Turning more warnings on by default catches more bugs more of the time.
This one tidbit from a larger series entitled What Every C Programmer Should Know About Undefined Behavior.
I have been religious about using -Wall -Werror but never paid much attention to -Wextra. Adding it to an existing project causes some minor pain, but it's worth it in the long run. From now on, it will be a part of my projects from day one.
- mheily's blog
- Login or register to post comments
