baloghadamsoftware added a comment.

In https://reviews.llvm.org/D39121#910715, @aaron.ballman wrote:

> The diagnostic tells the user that you surround the arg to strlen with parens 
> to silence the diagnostic, but the fixit doesn't do that -- it moves the 
> addition to the result. That's confusing behavior. However, if you add 
> another fixit to surround the arg with parens (and leave in the existing 
> one), then there are conflicting fixits (you don't want to apply them both) 
> which would also be confusing.


Then, I think we should rephrase the diagnostic message again. I am confident 
that in at least 99.9% of the cases adding 1 to the argument is a mistake. So 
the primary suggestion should be to move the addition to the result instead. 
The suggestion to put the argument in extra parentheses should be secondary, 
maybe also put in parentheses.


https://reviews.llvm.org/D39121



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to