|
From: <sv...@va...> - 2008-06-30 08:41:53
|
Author: bart
Date: 2008-06-30 09:41:59 +0100 (Mon, 30 Jun 2008)
New Revision: 8310
Log:
Enabled format string checking globally.
Modified:
branches/FORMATCHECK/exp-drd/Makefile.am
branches/FORMATCHECK/include/pub_tool_libcprint.h
Modified: branches/FORMATCHECK/exp-drd/Makefile.am
===================================================================
--- branches/FORMATCHECK/exp-drd/Makefile.am 2008-06-29 08:53:47 UTC (rev 8309)
+++ branches/FORMATCHECK/exp-drd/Makefile.am 2008-06-30 08:41:59 UTC (rev 8310)
@@ -29,7 +29,7 @@
DRD_CFLAGS=@FLAG_W_EXTRA@ @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@ \
-Wno-inline -Wno-unused-parameter \
- -O2 -DCHECK_FORMAT_STRINGS
+ -O2
AM_CFLAGS_X86_LINUX += $(DRD_CFLAGS)
AM_CFLAGS_AMD64_LINUX += $(DRD_CFLAGS)
Modified: branches/FORMATCHECK/include/pub_tool_libcprint.h
===================================================================
--- branches/FORMATCHECK/include/pub_tool_libcprint.h 2008-06-29 08:53:47 UTC (rev 8309)
+++ branches/FORMATCHECK/include/pub_tool_libcprint.h 2008-06-30 08:41:59 UTC (rev 8310)
@@ -32,14 +32,13 @@
#define __PUB_TOOL_LIBCPRINT_H
-/* Enable compile-time format string checking by gcc if the macro
- CHECK_FORMAT_STRINGS has been defined before this file has been included.
+/* Enable compile-time format string checking by gcc.
This feature is supported since at least gcc version 2.95.
For more information about the format attribute, see also
http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Function-Attributes.html.
*/
-#if defined(__GNUC__) && defined(CHECK_FORMAT_STRINGS)
+#if defined(__GNUC__)
#define PRINTF_CHECK(x, y) __attribute__((format(__printf__, x, y)))
#else
#define PRINTF_CHECK(x, y)
@@ -89,6 +88,11 @@
extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... ) PRINTF_CHECK(2, 3);
extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs ) PRINTF_CHECK(2, 0);
+
+/* Convert a string such that it can be inserted into an XML output stream. */
+extern HChar* VG_(ToXML)(const HChar* const str);
+
+
#endif // __PUB_TOOL_LIBCPRINT_H
/*--------------------------------------------------------------------*/
|