[LLVMbugs] [Bug 11257] New: "Unused parameter" warnings when compiling headers with gcc 4.5.3 and -Wall

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 28 11:35:37 PDT 2011


           Summary: "Unused parameter" warnings when compiling headers
                    with gcc 4.5.3 and -Wall
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Kevin.Harris at unisys.com
                CC: llvmbugs at cs.uiuc.edu

On our project, one of the aspects that we enjoy about LLVM is the fact that it
compiles cleanly with –Wall with gcc.  We were previously running with a gcc
4.1.x compiler, but we recently upgraded to gcc/g++ 4.5.3.  We were glad to see
that LLVM 2.9 still compiles cleanly with this version, even though the gnu
folks have added several warning messages in the intervening time.

Just this week, I decided to try the latest LLVM – the current trunk version
(3.1svn) and I also tried the tags/RELEASE_30 version.  I was surprised and
disappointed to see that, combined with the new gcc, and the changes to the
headers in the intervening time, our code no longer compiles cleanly.   In
particular, we are suffering several "Unused parameter" warnings.  These
warnings only appear when including headers for which functions are DEFINED -
rather than just declared.

It isn't obvious why these functions take these unused parameters, perhaps to
provide future functionality. I was able to suppress the warnings by adding a
harmless use of the offending variables in the bodies of the functions that
appear in the headers.

Our project doesn't use all the headers in LLVM by any means, so I obviously
don't have a complete list of all instances of this problem.  But I will list
all the instances that we're seeing in our builds, with associated line numbers
and names for each warning:

    Header                                   Line(s)          Name(s)
    llvm/Analysis/CFGPrinter.h               35, 47           Graph
    llvm/Assembly/AssemblyAnnotationWriter.h 35,41,47,53,58   F, OS, BB, I, V
    llvm/ExecutionEngine/JITEventListener.h  62, 74           F, Code, Size,
Details, OldPtr
    llvm/Support/DOTGraphTraits.h            64, 129, 135     Node, I

In all instances, the files are identical between the 3.0 rc1 and the 3.1svn
versions (rev 143124).

I'd be glad to attach my edited versions of these files upon request.

I was not able to find any previous bug reports on this topic.

It would be great if these "Unused parameter" problems could be resolved in the
final release version of 3.0.  Thanks in advance,

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