]> granicus.if.org Git - clang/commit
Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
authorTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 05:53:43 +0000 (05:53 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 05:53:43 +0000 (05:53 +0000)
commit44ca53f34deb5efe9fc6f246781f66f1ed83eabc
tree63306f4d419754370820d5e7376140d0b6b4fb3d
parentf1c7060076ef0c17fcc1ed12a098f25e53771adc
Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
for halting the propagation of uninitialized value tracking along
a path.  Unlike __attribute__((noreturn)), this attribute (which
is used by clients of the static analyzer) can be used to annotate
functions that essentially never return, but in rare cares may be
allowed to return for (special) debugging purposes.  This attribute
has been shown in reducing false positives in the static analyzer
by pruning false postives, and is equally applicable here.

Handling this attribute in the CFG itself is another option, but
this is not something all clients (e.g., possibly -Wunreachable-code)
would want to see.

Addresses <rdar://problem/12281583>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163681 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/UninitializedValues.cpp
test/Sema/uninit-variables.c