[llvm-bugs] [Bug 26178] Erroneous clang -Warray-bounds warning when preprocessing its own output (Triggered by ccache)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 16 11:45:39 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26178

David Blaikie <dblaikie at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dblaikie at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from David Blaikie <dblaikie at gmail.com> ---
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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160116/6551c382/attachment.html>


More information about the llvm-bugs mailing list