[cfe-dev] #error and #warning: why include "#error/#warning" in the diagnostic?

Ted Kremenek kremenek at apple.com
Wed Feb 1 08:51:33 PST 2012


On Feb 1, 2012, at 8:46 AM, Douglas Gregor wrote:

> *That* is a general flag that affects every diagnostic Clang can emit. It controls a formatting policy. 
> 
> What you're proposing is a flag that tweaks the wording of two specific diagnostics. It's too narrow in scope to warrant a special flag.
> 
>> More generally, I can see different clients wanting to control the diagnostic output of the compiler.  We can look for a general solution here; e.g., a single flag that can control various diagnostic options.
> 
> 
> Options that control general policies (color, word-wrapping, macro/template depth, carets, Fix-Its, ranges) all make sense. Options that tweak the wording of specific diagnostics don't, because it's not a useful thing for a user to think about ("oh, I *would* like that diagnostic to have a slightly different wording. let me go modify my build settingsā€¦") and because this solution just doesn't scale if we start resolving "what's the best wording?" discussions by adding a flag.

I agree in principle, but this isn't an academic problem.  For clients (e.g., an IDE) that don't want to include the #error or #warning in the diagnostic, because they have diagnostic categories to show to user, what would you propose as the solution?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120201/f148944b/attachment.html>


More information about the cfe-dev mailing list