http://llvm.org/bugs/show_bug.cgi?id=10594
Summary: C99 _Pragma unary operator should not expand into one
line
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Current _Pragma expansion method in some cases can produce wrong preprocessed
code if comments are not discarded.
This testcase can explain the problem much better:
int main() {
#define MACRO _Pragma("something")
MACRO // evil comment
test // this line is dead
}
The result of "clang -E -C" is or "clang -E -CC" is
...
int main() {
#pragma something
// evil comment test // this line is dead
}
Note that the test line is commented out.
The -C option can be used for static code analysis tools. The -CC option is
generally used to support lint comments.
Proposed code is something like
...
int main() {
# 3 "main.cpp"
#pragma something
# 3 "main.cpp"
// evil comment
test // this line is dead
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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