]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r2248: Merge of tridge's PRINTF_ATTRIBUTE fixes from samba4.
authorTim Potter <tpot@samba.org>
Wed, 8 Sep 2004 02:48:27 +0000 (02:48 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:37 +0000 (10:52 -0500)
(This used to be commit 53bfb76608efa347d5fe154c5583a5e8e3d53740)

source3/include/includes.h
source3/tdb/tdb.h

index 56624e5198c8c1f433415acc968cbca5e6ccbc68..58cb39790f2298264a964c615b8b10a59ff91ad5 100644 (file)
 #undef HAVE_TERMIOS_H
 #endif
 
-#ifdef __GNUC__
+#if (__GNUC__ >= 3)
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
- * argument.  **/
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
 #else
 #define PRINTF_ATTRIBUTE(a1, a2)
index 3db676a633f8bb5d7f178b9c0d0f17dabf492c80..e8a6d201c5978639e15405f36a4e2cd15f2ab4e0 100644 (file)
@@ -32,7 +32,15 @@ extern "C" {
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#if (__GNUC__ >= 3)
 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
 #endif
 
 /* flags to tdb_store() */