http://llvm.org/bugs/show_bug.cgi?id=21537

            Bug ID: 21537
           Summary: Clang warnings are inconsistent between compiling from
                    C source to object code and preprocessed C source to
                    object code
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13322
  --> http://llvm.org/bugs/attachment.cgi?id=13322&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to