[cfe-dev] Warning options table

Ted Kremenek kremenek at apple.com
Wed Mar 11 12:21:51 PDT 2009


On Mar 11, 2009, at 11:33 AM, Sebastian Redl wrote:

> Ted Kremenek wrote:
>> Concerning your point above, I still think that warning groups need  
>> to
>> be declarative, where a warning says (either implicitly or  
>> explicitly)
>> that it is part of a warning group.  Explicitly having to declare
>> warning groups seems highly suboptimal.
>>
>> We can then have a separate .td entry that tells how a warning group
>> maps to a command-line option.
> What is the point of warning groups, other than being able to control
> several warnings with a single option?

Hi Sebastian,

I'm a little confused.  That is the whole point.  The idea is to have  
a declarative way to specify what warnings belong to what groups.  A  
warning option then maps to a specific warning or a warning group.   
The idea is to declaratively specify warning groups, and then have a  
warning option either map to a single warning (which can be thought of  
as a singleton warning group) or a warning group.

The approach you describe conflates warning groups and warning  
options.  Warning options are part of the command line interface,  
where warning groups are part of the  underlying "API interface" to  
warnings.  Another client of the Clang libraries may wish to turn off  
groups of warnings without reasoning about warning options.

I see these merely as a separation of concerns.  Warning options are a  
command-line interface concept, where warning groups are a Clang  
library concept.

> The organizational units (Sema,
> Parse, ...) aside, I mean.
>
> In the files I checked in, there aren't any warning groups any more
> (again, not counting Sema & friends).

Yes, this discussion is not about Sema & friends.

> There's warnings, and there's
> warning options. Each warning option specifies which warnings it
> controls, which I feel is exactly the way it should be. Purely for
> convenience, a warning option can include all warnings of another
> warning option by specifying that.

I think some of my confusion would be resolved if you gave some  
example code (e.g., TableGen pseudocode) of how you plan on mapping  
warning options to warnings.  We may actually be agreeing with each  
other, and some code might clarify some things.



More information about the cfe-dev mailing list