Add 'remark' diagnostic type in clang

Arthur O'Dwyer arthur.j.odwyer at gmail.com
Tue Feb 25 11:30:32 PST 2014


On Tue, Feb 25, 2014 at 3:29 AM, Chris Lattner <clattner at apple.com> wrote:
>
> Is "remark" better than "informative" diagnostics?
> Is there prior art in other compilers that would be worth following?

There is prior art in the Edison Design Group compiler. As I never
tire of mentioning, EDG doesn't force a taxonomy on its diagnostics
(which leads to silliness like -W, -Wall, -Weverything…) but simply
assigns each diagnostic a single identifying serial number. The user
is allowed to specify the //severity level// of each diagnostic, for
example you can say "I want diag 142 to be an error, diag 1733 to be a
warning, diags 1844 through 1900 to be remarks, diags 17 and 49 to be
suppressed; and stop the build on warnings."
Driver options such as -Wall are defined in terms of these operations;
for example the driver might transform `-Wformat` into
`--diag_warning=1744-1746,1901,1907`.
Some diagnostics are remarks by default. Other diagnostics are
suppressed by default. (Their severity level can be elevated in the
usual way as described above.)
By default, remarks are not printed to the user. There is a
`--remarks` driver option which causes remarks to be printed. (This is
NOT the same thing as elevating their severity level! It is simply a
change in the compiler's chattiness.)

I don't know of any compiler that uses the term "informative".
Besides, that's redundant; *all* compiler diagnostics are purely
"informative" by definition. The variable here is //severity//:
fatal-error, recoverable-error, warning, remark, silent.

my $.02,
–Arthur




More information about the cfe-commits mailing list