<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - clang seems limited to uint32 line numbers"
   href="https://bugs.llvm.org/show_bug.cgi?id=40870">40870</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang seems limited to uint32 line numbers
          </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>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>jg@jguk.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Two parts of #line numbers have an issue. So I am filing together.

1) clang seems limited to uint32 line numbers
and then wraparound back to 0 even !
I know many people won't ever encounter this, but good to define it.

Better to change it to 64bit?

If there must be a limit, better to change "directive requires a positive
integer argument" to show the limit


Also better to fix it on the line limit?  4294967295

ie ""directive requires a positive integer argument 1 - 4294967295" 


2) #line 0 is not allowed by C spec, but Clang allows it

int main(void)
{
        #line 0
    #warning msg1
}




from godbolt.org

#1 with x86-64 clang (trunk)
<source>:4294967295:6: warning: msg1 [-W#warnings]
    #warning msg1
     ^
<source>:0:8: error: #line directive requires a positive integer argument
        #line 4294967296
              ^
<source>:1:6: warning: msg2 [-W#warnings]
    #warning msg2
     ^
2 warnings and 1 error generated.

Compiler returned: 1



int main(void)
{
        #line 4294967295
    #warning msg1
        #line 4294967296
    #warning msg2
}</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>