diff options
author | das <das> | 2009-09-07 06:20:50 (GMT) |
---|---|---|
committer | das <das> | 2009-09-07 06:20:50 (GMT) |
commit | 71419c7600e07b055614f65a8617ff25e63c1603 (patch) | |
tree | d784f69b6c1c089f0963ea053653bd259dac2a05 | |
parent | 226a09d6505397a8c4c0299ece7da620ba8666cd (diff) | |
download | tk-71419c7600e07b055614f65a8617ff25e63c1603.zip tk-71419c7600e07b055614f65a8617ff25e63c1603.tar.gz tk-71419c7600e07b055614f65a8617ff25e63c1603.tar.bz2 |
make support for clang static analyzer safer & cleaner
-rw-r--r-- | generic/tkInt.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h index c4086af..6f85485 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: $Id: tkInt.h,v 1.110 2009/09/04 09:55:17 dkf Exp $ + * RCS: $Id: tkInt.h,v 1.111 2009/09/07 06:20:50 das Exp $ */ #ifndef _TKINT @@ -949,19 +949,21 @@ MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable; #endif /* - * Macros for clang static analyzer + * Support for Clang Static Analyzer <http://clang-analyzer.llvm.org> */ -#if defined(PURIFY) && defined(__clang__) && !defined(CLANG_ASSERT) +#if defined(PURIFY) && defined(__clang__) +#if __has_feature(attribute_analyzer_noreturn) && \ + !defined(Tcl_Panic) && defined(Tcl_Panic_TCL_DECLARED) +void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); +#endif +#if !defined(CLANG_ASSERT) #include <assert.h> #define CLANG_ASSERT(x) assert(x) -#ifndef USE_TCL_STUBS -EXTERN void Tcl_Panic(const char * format, ...) - __attribute__((analyzer_noreturn)); #endif #elif !defined(CLANG_ASSERT) #define CLANG_ASSERT(x) -#endif +#endif /* PURIFY && __clang__ */ /* * The following magic value is stored in the "send_event" field of FocusIn |