[LLVMbugs] [Bug 13077] New: -Wno-unused-parameter has no effect when used with -W

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 11 01:15:28 PDT 2012


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

             Bug #: 13077
           Summary: -Wno-unused-parameter has no effect when used with -W
           Product: clang
           Version: 3.0
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dea+clangbugs+reg at overblown.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When using clang++, using the warning flag "-W" normally turns on warnings
about unused parameters. Presumably, the flag "-Wno-unused-parameters" should
then turn off specific warning. The intent being, the user wants to turn on
nearly all warnings contained in -W, except a few specific ones. However, clang
currently ignores the "-Wno-unused-parameters" flag when -W is also set, and
will warn about unused parameters. I believe this to be a bug, or at least
behavior that is counterintuitive.

This bug happens regardless of whether -W comes before or after
-Wno-unused-parameters on the command line.

The desired behavior should be that clang will disable warnings about unused
parameters if -Wno-unused-parameters is included after whatever flag turned on
-Wunused-parameters.

GCC had a similar bug report a few years ago, and patched the behavior to work
as desired above -- see 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28875 .

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