<html>
    <head>
      <base href="http://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 --- - -frewrite-includes doesn't handle Windows UTF-8 BOM"
   href="http://llvm.org/bugs/show_bug.cgi?id=15664">15664</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-frewrite-includes doesn't handle Windows UTF-8 BOM
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paul_robinson@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>when Clang crashes, it will create a preprocessed file using
-frewrite-includes.
Unfortunately this does not strip byte-order marks from included headers.
(<a href="http://en.wikipedia.org/wiki/Byte_order_mark">http://en.wikipedia.org/wiki/Byte_order_mark</a>)

Attached bom.c is a regular text file, bom.h is encoded as UTF-8 with BOM.

C:\Data\scratch>clang -c bom.c 
C:\Data\scratch>clang -E bom.c > bom-E.c
C:\Data\scratch>clang -c bom-E.c
C:\Data\scratch>clang -E -frewrite-includes bom.c > bom-E2.c
C:\Data\scratch>clang -c bom-E2.c
./bom.h:1:1: error: non-ASCII characters are not allowed outside of literals
and

      identifiers
<U+FEFF>void foo();
^~~~~~~~
1 error generated.

C:\Data\scratch>clang --version
clang version 3.3 (178499)
Target: i686-pc-win32
Thread model: posix</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>