Live data from Hacker News

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

gcc.gnu.org

1–5 of 5 posts

Re: GCC 4.6 - Support for selectively enabling and disabling warnings via #pragma

#2
I'm amazed it took this long but these changes are very VERY welcome:

G++ now issues clearer diagnostics for missing semicolons after class, struct, and union definitions.

G++ now issues clearer diagnostics for missing semicolons after class member declarations.

G++ now issues clearer diagnostics when a colon is used in a place where a double-colon was intended.

Re: GCC 4.6 - Support for selectively enabling and disabling warnings via #pragma

#4

I'm amazed it took this long but these changes are very VERY welcome: G++ now issues clearer diagnostics for missing semicolons after class, struct, and union definitions. G++ now issues clearer diagnostics for missing semicolons after class member declarations. G++ now issues clearer diagnostics when a colon is used in a place where a double-colon was intended.

I guess that partly is because they got competition that showed such things are possible at all (http://clang.llvm.org/diagnostics.html).

C++ is notoriously hard to parse, and even harder to produce useful error messages for.

Re: GCC 4.6 - Support for selectively enabling and disabling warnings via #pragma

#5
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.