https://llvm.org/bugs/show_bug.cgi?id=24623

            Bug ID: 24623
           Summary: Error on redefinition of builtin functions.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: chengnian...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

I declare a variable with the name "rint", which accidentally is a builtin
function. Then clang rejects the code, although I do not include the header
file <math.h>. 

Even though this behavior was deliberate, the message is still confusing,
"tmp.c:1:5: note: previous definition is here", as the first line is not the
the location of the previous definition. 


$ clang-trunk -O0 -c tmp.c

tmp.c:1:5: error: redefinition of 'rint' as different kind of symbol

int rint; 

    ^

tmp.c:1:5: note: previous definition is here

1 error generated.

$ 

$ gcc-trunk -O0 -c tmp.c

tmp.c:1:5: warning: built-in function ‘rint’ declared as non-function

 int rint; 

     ^

$ 

$ cat tmp.c

int rint; 



$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to