[llvm-bugs] [Bug 30529] New: clang generates warnings if use preprocessed files.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 26 10:29:00 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30529

            Bug ID: 30529
           Summary: clang generates warnings if use preprocessed files.
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yunlian at chromium.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

#define T(x) (x==1)

int main(){
  int x = 1;
  if (T(x)) {
    return 0;}
  return 1;
}


clang -Wall a.c returns no warning.

clang a.c -E > a.i

clang -Wall a.i

returns

a.c:5:9: warning: equality comparison with extraneous parentheses
[-Wparentheses-equality]
  if ((x==1)) {
       ~^~~
a.c:5:9: note: remove extraneous parentheses around the comparison to silence
this warning
  if ((x==1)) {
      ~ ^  ~
a.c:5:9: note: use '=' to turn this equality comparison into an assignment
  if ((x==1)) {
        ^~
        =
1 warning generated.

-- 
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/20160926/da5fb768/attachment.html>


More information about the llvm-bugs mailing list