summaryrefslogtreecommitdiffstats
path: root/generic/tkInt.h
diff options
context:
space:
mode:
authordas <das>2009-06-30 00:56:29 (GMT)
committerdas <das>2009-06-30 00:56:29 (GMT)
commit1bc826ea6368b845b99e8ac3289521e623239e90 (patch)
tree486c789f1ba88a841ef3162ce8911a86ac67a5ff /generic/tkInt.h
parent809b381e2db8d3243e35cd569e40d2cccb781e20 (diff)
downloadtk-1bc826ea6368b845b99e8ac3289521e623239e90.zip
tk-1bc826ea6368b845b99e8ac3289521e623239e90.tar.gz
tk-1bc826ea6368b845b99e8ac3289521e623239e90.tar.bz2
* generic/tkInt.h: add assert macros for clang static
analyzer and redefine Tcl_Panic to assert after panic in clang PURIFY builds. * generic/tkImgPhInstance.c: small fixes to make clang static * generic/tkTextDisp.c: analyzer happier. * generic/tkConfig.c: add clang assert for false positives * generic/tkUndo.c: from static analyzer.
Diffstat (limited to 'generic/tkInt.h')
-rw-r--r--generic/tkInt.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index badad64..672160c 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.103 2009/06/27 19:33:35 nijtmans Exp $
+ * RCS: $Id: tkInt.h,v 1.104 2009/06/30 00:56:29 das Exp $
*/
#ifndef _TKINT
@@ -982,6 +982,20 @@ MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable;
#endif
/*
+ * Macros for clang static analyzer
+ */
+
+#if defined(PURIFY) && defined(__clang__) && !defined(CLANG_ASSERT)
+#include <assert.h>
+#define CLANG_ASSERT(x) assert(x)
+#define Tcl_PanicEx Tcl_Panic
+#undef Tcl_Panic
+#define Tcl_Panic(f, ...) Tcl_PanicEx(f,##__VA_ARGS__); CLANG_ASSERT(0)
+#elif !defined(CLANG_ASSERT)
+#define CLANG_ASSERT(x)
+#endif
+
+/*
* The following magic value is stored in the "send_event" field of FocusIn
* and FocusOut events. This allows us to separate "real" events coming from
* the server from those that we generated.