<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 reports incorrect line numbers for errors in assembly files"
   href="https://bugs.llvm.org/show_bug.cgi?id=34950">34950</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang reports incorrect line numbers for errors in assembly files
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mike.benfield@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If my assembly file has comments, clang reports incorrect line numbers.


$ cat trash.s
.intel_syntax noprefix

.text
        .global _main
_main:
        # text
        # text
        # text
        # text
        # text
        mov     bogus_name, 20
        # text
        # text
        # text
        # text
        # text
        mov     rax, 5
        ret
$ clang trash.s
trash.s:16:6: error: ambiguous operand size for instruction 'mov'
 mov bogus_name, 20
     ^~~~~~~~~~


That should be line 11, but it says 16.


Note that this is presumably caused by the same underlying problem as Bug
33664, which I reported earlier. I decided to report this new bug with a
different manifestation of the problem, because the other bug report got no
attention, despite apparently being critical to the basic usability of the
assembler. (Speaking of which... someone else somewhere is actually using
clang's assembler, right? It seems odd that a bug like this, one which surely
anyone using the software would notice and be frustrated by, could persist for
so long.)</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>