On Thu, Feb 14, 2019 at 11:26:15AM -0500, David Malcolm wrote: > There's an asymmetry in the warning; it's looking for a comparison of a > LHS expression against an RHS constant 0, spelled as "0". > > If we fold_for_warn on the RHS, then that folding introduces a warning > for expressions that aren't spelled as "0" but can be folded to 0, > e.g., with: > > enum { FOO, BAR };
So, shouldn't it be made symmetric? Check if one argument is literal 0 before folding, and only if it is, fold_for_warn the other argument? Jakub