Skip to content

Comment on GCC 4.6 - Support for selectively enabling and disabling warnings via #pragma

Comments

While this is a nice improvement, it still needs work. The biggest problem is that:

1. Not all warnings have a -W command line option.

2. Sometimes a single -W option will control more than warning message.

Contrast this with pretty much every Microsoft Compiler (cl, csc, vbc, fsc, ilasm), where:

1. Every error and warning message has a unique number

2. The error pragmas and command line options all take numbers as input.

3. Errors and warnings are prefixed by their number in compiler output.

This makes it easy to know exactly what's being disabled, and what you need to type to disable any warning just by reading the compiler output. Doing that with gcc requires a lot of searching through docs, and usually a bit of trial and error. I wish gcc would adopt the Microsoft model here.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.