Closed Quuxplusone closed 8 years ago
Bugzilla Link | PR26178 |
Status | RESOLVED INVALID |
Importance | P normal |
Reported by | Shlomi Fish (shlomif@shlomifish.org) |
Reported on | 2016-01-16 13:40:02 -0800 |
Last modified on | 2016-01-16 13:45:39 -0800 |
Version | 3.7 |
Hardware | PC Linux |
CC | dblaikie@gmail.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I take it the bug you're reporting is that clang produces this warning when running over the preprocessed output, but does not produce the warning when running over the original code?
That is not itself a bug - Clang's diagnostic system detects the use of macros and uses them as hints to improve warning quality. Clang does not intend to produce the same output on preprocessed and non-preprocessed inputs.
For tools like ccache, you could consider using things like Clang's -frewrite-includes feature which handles the #includes but leaves macros in tact so that Clang's warning infrastructure can still see them. (include based warning behavior - such as suppressing certain warnings in system headers, may still work with -frewrite-includes output, I think (but don't quote me on that), since the file still has line directives to indicate which bits of code came from which header)