On Feb 5, 2012, at 1:19 PM, Enea Zaffanella <[email protected]> wrote:

> On 02/05/2012 09:17 PM, Chad Rosier wrote:
>> Hi Enea,
> 
> [...]
> 
>>> Why this change?
>> 
>> This change makes clang more consistent with how gcc handles warning 
>> options.  Previously, something such as "-Werror=foo -Wall" would result in 
>> foo only being a warning, not an error.  This is not consistent with gcc.  
>> Conversely, "-Wall -Werror=foo" would result in a error.
>> 
>>> There are warnings that are mapped by default to errors.
>>> After this change, clients no longer have the option of mapping them back 
>>> to warnings, which is obviously wrong.
>> 
>> Not true; to downgrade an error to a warning use '-Wno-error=foo', where foo 
>> is the specific warning.
>> 
>>  Chad
> 
> We are interested in changing the diagnostic mapping when using clang as a 
> library (i.e., without using command line options). We were previously using 
> the method setDiagnosticMapping(), but this no longer works. The doxygen 
> documentation for the method says:
> 
>  void setDiagnosticMapping (diag::kind Diag,
>                             diag::Mapping Map,
>                             SourceLocation Loc)
>  This allows the client to specify that certain warnings are ignored.
>  Notes can never be mapped, errors can only be mapped to fatal, and
>  WARNINGs and EXTENSIONs can be mapped arbitrarily.
> 
> 
> Looks like the specification above no longer matches the implemented behavior 
> (some of our calls to the method for remapping warnings are now _silently_ 
> ignored). Anyway, this would still be OK, provided we know an alternative 
> function/method we should call. So, what code should we write in order to 
> change the default mapping of a warning that is mapped by default to error 
> (e.g., warn_return_missing_expr)?

Thank you for the clarification.  Feel free to revert this commit if you need 
this fixed immediately.  Otherwise, I will look into reworking this tomorrow 
morning.

 Chad

> Enea.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to