[LLVMbugs] [Bug 9422] New: Fix for bug 5544 does not always work when -Werror is in use

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 7 15:22:56 PST 2011


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

           Summary: Fix for bug 5544 does not always work when -Werror is
                    in use
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dimitry at andric.com
                CC: llvmbugs at cs.uiuc.edu


The fix for bug 5544, committed in r126762, does not seem to work
completely when using -Werror.  The problem is not always triggered,
though; there should be some other warning, for example generated by a
higher warning level, e.g. using the same sample as in bug 5544:

$ clang -v
clang version 2.9 (trunk 127164)
Target: i386-unknown-freebsd9.0
Thread model: posix
$ clang -c pr5544.c

No warnings here, fine.

$ clang -Wextra -c pr5544.c
pr5544.c:9:22: warning: unused parameter 'argv' [-Wunused-parameter]
main(int argc, char *argv[])
                     ^
1 warning generated.

Okay, that gives one warning, now let's turn on -Werror too:

$ clang -Wextra -Werror -c pr5544.c
pr5544.c:9:22: error: unused parameter 'argv' [-Werror,-Wunused-parameter]
main(int argc, char *argv[])
                     ^
pr5544.c:13:24: error: shift count is negative [-Werror]
        printf("%"PRIx64"\n", FOO(1));
                              ^~~~~~
pr5544.c:6:48: note: instantiated from:
    (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0))
                                               ^ ~~~~~~~~~
2 errors generated.

Now suddenly it has two errors, and it triggers on the unreachable code
anyway?

-- 
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