[LLVMbugs] [Bug 10703] New: no warning for << versus + precedence confusion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 18 17:08:52 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10703

           Summary: no warning for << versus + precedence confusion
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu


clang produces no warnings for the following:

  int x[4] = // ...
  int k = x[0] << 24 + x[1] << 16 + x[2] << 8 + x[3];

This parses as:

  int k = x[0] << (24 + x[1]) << (16 + x[2]) << (8 + x[3]);

Such a warning would need to be careful to not fire on:

  std::cout << x[0] << 24 + x[1] << 16 + x[2] << 8 + x[3];

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list