[LLVMbugs] [Bug 4892] New: templates and friends cause false positive complaints

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Sep 4 15:04:03 PDT 2009


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

           Summary: templates and friends cause false positive complaints
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jreiser at BitWagon.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3433)
 --> (http://llvm.org/bugs/attachment.cgi?id=3433)
gzipped, pre-processed C++ source code

I get many false positive complaints (hundreds per file) that appear to be
caused by templates and friend classes in C++.  This obscures any potential
benefits of using the tools.

The attached file is compressed with gzip after being generated by "g++ -E
p_mach.cpp" with the correct -I options, etc.  The original source is available
from https://www.pysol.org:4443/hg/upx.hg .

The incorrect complaints start with:
-----
$ /usr/local/llvm/libexec/clang-cc -fsyntax-only foo.cxx
p_mach.cpp:85:5: error: use of undeclared identifier 'bele'
    bele = N_BELE_CTP::getRTP((const BeLePolicy*) __null);
    ^
p_mach.cpp:168:5: error: no matching function for call to 'addLoader'
    addLoader("MACOS000", __null);
    ^~~~~~~~~
p_mach.cpp:171:13: error: use of undeclared identifier 'ph'
        ( ((ph.method) >= 8 && (ph.method) <= 10) ? "NRV_HEAD,NRV2E,NRV_TAIL"
            ^
p_mach.cpp:176:9: error: no matching function for call to 'hasLoaderSection'
    if (hasLoaderSection("CFLUSH"))
        ^~~~~~~~~~~~~~~~
p_mach.cpp:177:9: error: no matching function for call to 'addLoader'
        addLoader("CFLUSH");
        ^~~~~~~~~
p_mach.cpp:178:5: error: no matching function for call to 'addLoader'
    addLoader("ELFMAINY,IDENTSTR,+40,ELFMAINZ,FOLDEXEC", __null);
    ^~~~~~~~~
p_mach.cpp:290:5: error: no matching function for call to 'initLoader'
    initLoader(proto, szproto);
    ^~~~~~~~~~
p_mach.cpp:296:34: error: use of undeclared identifier 'ph'
    h.b_method = (unsigned char) ph.method;
                                 ^
p_mach.cpp:297:32: error: use of undeclared identifier 'ph'
    h.b_ftid = (unsigned char) ph.filter;
                               ^
p_mach.cpp:298:32: error: use of undeclared identifier 'ph'
    h.b_cto8 = (unsigned char) ph.filter_cto;
                               ^
p_mach.cpp:306:17: error: use of undeclared identifier 'ph'
        __null, ph.method, 10, __null, __null );
                ^
p_mach.cpp:314:5: error: use of undeclared identifier 'linker'
    linker->addSection("FOLDEXEC", cprLoader, sizeof(h) + h.sz_cpr, 0);
    ^
p_mach.cpp:324:5: error: no matching function for call to 'relocateLoader'
    relocateLoader();
    ^~~~~~~~~~~~~~
p_mach.cpp:384:32: error: no matching function for call to 'getLoader'
    unsigned char *const ptr = getLoader();
                               ^~~~~~~~~
p_mach.cpp:389:36: error: use of undeclared identifier 'lsize'
    lp->l_lsize = (unsigned short) lsize;
                                   ^
-----


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