<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Error on redefinition of builtin functions."
   href="https://llvm.org/bugs/show_bug.cgi?id=24623">24623</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error on redefinition of builtin functions.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chengniansun@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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; 



$</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>