[cfe-commits] r125640 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaChecking.cpp lib/Sema/SemaExpr.cpp test/Analysis/out-of-bounds.c test/Sema/array-bounds.c
Douglas Gregor
dgregor at apple.com
Thu Feb 17 09:40:23 PST 2011
On Feb 17, 2011, at 9:36 AM, Chris Lattner wrote:
>
> On Feb 17, 2011, at 9:29 AM, Chandler Carruth wrote:
>
>> On Thu, Feb 17, 2011 at 9:25 AM, Chris Lattner <clattner at apple.com> wrote:
>> so it's the same as the other case. I thought we already had some infrastructure for disabling warnings in unreachable code?
>>
>> Only in as much as the CFG we build for a few warnings will prune provably dead code. We're not using that here, this is a type-based warning. And I have to agree with Ted that these are all time-bombs in the code, waiting for a future maintainer to create a runtime error.
>
> I'm fine with that in this case, the problem is that we have other warnings that get emitted in dead branches of ?: expressions etc, which occur due to macro expansion.
This general problem could be addressed by extending Sema::DiagRuntimeBehavior() to delay its diagnostics until we know whether this code is reachable or not. Currently, this routine emits diagnostics for any potentially-evaluated context.
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110217/04baa0e4/attachment.html>
More information about the cfe-commits
mailing list