dexonsmith added a comment.

In https://reviews.llvm.org/D47687#1126074, @lebedev.ri wrote:

> In https://reviews.llvm.org/D47687#1126032, @Higuoxing wrote:
>
> > In https://reviews.llvm.org/D47687#1125926, @rnk wrote:
> >
> > > @dexonsmith is there someone from Apple who can comment on rdar://8678458 
> > > and the merits of disabling this warning in macros? I strongly suspect 
> > > the original report was dealing with code like `assert(x || y && 
> > > "str");`, if so we can go forward with this.
> > >
> > > @chandlerc I know you've hit this behavior difference vs. GCC before. Any 
> > > thoughts on the proposed change?
> >
> >
> >
> >
> > In https://reviews.llvm.org/D47687#1125964, @dexonsmith wrote:
> >
> > > In https://reviews.llvm.org/D47687#1125926, @rnk wrote:
> > >
> > > > @dexonsmith is there someone from Apple who can comment on 
> > > > rdar://8678458 and the merits of disabling this warning in macros? I 
> > > > strongly suspect the original report was dealing with code like 
> > > > `assert(x || y && "str");`, if so we can go forward with this.
> > >
> > >
> > > There were two commits with this radar: r119537 and r119540.  The main 
> > > motivation was a deeply nested macro that when "inlined" included the 
> > > moral equivalent of `#define DOUBLE_OP(OP1, OP2, X, Y, Z) (X OP1 Y OP2 
> > > Z)`.  There was terrible note spew when the warning fired in this case, 
> > > and the use case for the macro made the warning un-actionable.  We 
> > > decided to suppress the warning entirely:
> > >
> > > > As a general comment, the warning seems to be useless for macros; I'll 
> > > > follow the example of warn_logical_instead_of_bitwise which doesn't 
> > > > trigger for macros and I'll make the warning not warn for macros.
> >
> >
> > Hi, Thank you,
> >
> > I noticed that `warn_logical_instead_of_bitwise ` will also skip 
> > parentheses checking in macros... well, this patch seems not so 
> > necessary... both ok for me ... depends on all of you :-)
>
>
> At worst, we can issue this warning in a new `-Wparentheses-in-macros` 
> subgroup, which, if apple so insists, could be off-by-default.
>  That would less worse than just completely silencing it for the entire world.


I’d be fine with strengthening the existing warning as long as there is an 
actionable fix-it.  I suspect if you suppress it when the relevant expression 
is constructed from multiple macro arguments that will be good enough.


https://reviews.llvm.org/D47687



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

Reply via email to