[Bug c++/70065] New: Add a new option to suppress a warnings about operators priority

beaux_monde at tut dot by gcc-bugzilla@gcc.gnu.org
Thu Mar 3 13:23:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70065

            Bug ID: 70065
           Summary: Add a new option to suppress a warnings about
                    operators priority
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: beaux_monde at tut dot by
  Target Milestone: ---

Created attachment 37856
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37856&action=edit
The patch

Hello.
I have a patch which adds an option to suppress warnings about operators'
precedence. For example for this code

bool a, b, c;

// Something...

if(a && b || c)
{
  // Do something...
}

g++ will print the "Suggest parenthesis around a && b" warning. But the &&
operator has a higher priority, so parenthesis here needed to ensure that all
is OK.


More information about the Gcc-bugs mailing list