https://llvm.org/bugs/show_bug.cgi?id=31886
Bug ID: 31886 Summary: in -traditional mode, the preprocessor should only process directives whose '#' appears in column 1 Product: clang Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: froy...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Relaying this bug report on behalf of Zack Weinberg: In -traditional mode, the preprocessor should only process directives whose '#' appears in column 1. For instance, in this fragment ... #ifndef foo #ifdef bar quux #endif #endif ... no tokens survive preprocessing in the standard mode, but the expected output of 'cc -E -traditional' (ignoring blank lines and line number annotations) is #ifdef bar quux #endif clang, however, has a bug in which the nested #endif is *not* ignored, causing the subsequent non-nested #endif to trigger an error: #ifdef bar quux test.c:5:2: error: #endif without #if #endif ^ 1 error generated. This may not just affect #endif: clang preprocesses *this* fragment ... /* this comment is not indented */ #ifdef bar quux #else greeble #endif ... to just 'greeble' and no errors, with or without -traditional. I observe this behavior with both 'clang version 3.8.1-17 (tags/RELEASE_381/final)' and 'clang version 3.9.1-4 (tags/RELEASE_391/rc2)' as supplied by Debian. Another person has reported identical behavior with 'Apple LLVM version 8.0.0 (clang-800.0.42.1)'. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs