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

             Bug #: 15151
           Summary: Ambigious error message when a variable is named after
                    a standard function
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


The following code gives an ambiguous error message in clang, but a sane one in
gcc:

int logf = 5;
int main() {
        return logf;
}

# gcc test.c -o test
test.c:1:5: warning: built-in function 'logf' declared as non-function [enabled
by default]
# clang test.c -o test
test.c:1:5: error: redefinition of 'logf' as different kind of symbol
int logf = 5;
    ^
test.c:1:5: note: previous definition is here
test.c:4:16: warning: incompatible pointer to integer conversion returning
'float (float)' from a function with result type 'int' [-Wint-conversion]
        return logf;
               ^~~~
1 warning and 1 error generated.

Suggest something like gcc instead: "error: redefinition of built-in/standard
function 'logf' as different kind of symbol", and remove "note: previous
definition is here", or alternatively, just change the second line to "note:
previous definition is in standard library" or similar.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to