[llvm-bugs] [Bug 31415] New: Compiler should not warn about operator precedence by default

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 17 09:33:43 PST 2016


            Bug ID: 31415
           Summary: Compiler should not warn about operator precedence by
           Product: clang
           Version: 3.9
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fuzxxl at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

clang has a number of diagnostics warning about code that uses the C operator
precedence table in a way some programmers misunderstand. This category of
warnings is occasionally useful in catching bugs.

However, these warnings should not be enabled by default (i.e. without any
-W... switched) as they usually do not indicate incorrect code. Indeed, full
usage of the C operator precedence rules is *not* indicative of a wrong program
and clang warning about that causes an exceptional amount of noise during
compilation of perfectly fine code. As by the guideline that all default
warnings should only be warnings that indicate serious problems or likely
mistakes, I believe that operator precedence warnings should not be enabled by
default. I request that they be disabled by default and only enabled if
explicitly requested (e.g. with -Wall).

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161217/e5a19b1c/attachment.html>

More information about the llvm-bugs mailing list