<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 --- - Clang warnings are inconsistent between compiling from C source to object code and preprocessed C source to object code"
   href="http://llvm.org/bugs/show_bug.cgi?id=21537">21537</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang warnings are inconsistent between compiling from C source to object code and preprocessed C source to object code
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.5
          </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>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>jonathan.hamilton@imgtec.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>Created <span class=""><a href="attachment.cgi?id=13322" name="attach_13322" title="C test code having a tautological comparison as the result of a preprocessor macro expansion.">attachment 13322</a> <a href="attachment.cgi?id=13322&action=edit" title="C test code having a tautological comparison as the result of a preprocessor macro expansion.">[details]</a></span>
C test code having a tautological comparison as the result of a preprocessor
macro expansion.

Clang appears to handle some symbols differently with respect to warnings
depending on if the code is the result of a preprocessor macro expansion or
not.

This causes an inconsistency between pre-processing and compiling a source file
in one step to preprocessing then compiling as two stages.

For example, using the attached test program building (with clang 3.5.0 on
x86_64) with the following command line:

clang -Werror tautological-compare-in-macro.c -o /dev/null -c

succeeds with no warnings/errors. However running:

clang -Werror tautological-compare-in-macro.c -o
tautological-compare-in-macro.p -E
clang -Werror -x c tautological-compare-in-macro.p -o /dev/null -c

causes it to emit a warning (-Wtautological-compare, which causes this to fail
due to -Werror)

This is rather annoying when large projects add -Werror to their build systems.
This example was specifically seen (and significantly simplified from) a file
in Android.</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>