[LLVMbugs] [Bug 13011] New: improve diagnostic when function parameter obfuscates function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 1 17:47:57 PDT 2012


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

             Bug #: 13011
           Summary: improve diagnostic when function parameter obfuscates
                    function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nunoplopes at sapo.pt
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Just spotted this bug in a large code base today:

void free(void*);

void foo(int free) {
    free(0);
}


clang prints:
x.c:4:6: error: called object type 'int' is not a function or function pointer
        free(0);
        ~~~~^


It took me a while to figure out what was going on (the parameter list didn't
fit in the screen).

Maybe clang could give a better error message if it detects that there is a
proper function somewhere in the symbol table stack, which is being redefined
later.

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