svn commit: samba r2248 - branches/SAMBA_3_0/source/include branches/SAMBA_3_0/source/tdb trunk/source/include trunk/source/tdb

tpot at samba.org tpot at samba.org
Wed Sep 8 02:48:27 GMT 2004


Author: tpot
Date: 2004-09-08 02:48:27 +0000 (Wed, 08 Sep 2004)
New Revision: 2248

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2248&nolog=1

Log:
Merge of tridge's PRINTF_ATTRIBUTE fixes from samba4.

Modified:
   branches/SAMBA_3_0/source/include/includes.h
   branches/SAMBA_3_0/source/tdb/tdb.h
   trunk/source/include/includes.h
   trunk/source/tdb/tdb.h


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===================================================================
--- branches/SAMBA_3_0/source/include/includes.h	2004-09-08 00:00:56 UTC (rev 2247)
+++ branches/SAMBA_3_0/source/include/includes.h	2004-09-08 02:48:27 UTC (rev 2248)
@@ -45,10 +45,11 @@
 #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)

Modified: branches/SAMBA_3_0/source/tdb/tdb.h
===================================================================
--- branches/SAMBA_3_0/source/tdb/tdb.h	2004-09-08 00:00:56 UTC (rev 2247)
+++ branches/SAMBA_3_0/source/tdb/tdb.h	2004-09-08 02:48:27 UTC (rev 2248)
@@ -32,8 +32,16 @@
 #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() */
 #define TDB_REPLACE 1

Modified: trunk/source/include/includes.h
===================================================================
--- trunk/source/include/includes.h	2004-09-08 00:00:56 UTC (rev 2247)
+++ trunk/source/include/includes.h	2004-09-08 02:48:27 UTC (rev 2248)
@@ -45,10 +45,11 @@
 #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)

Modified: trunk/source/tdb/tdb.h
===================================================================
--- trunk/source/tdb/tdb.h	2004-09-08 00:00:56 UTC (rev 2247)
+++ trunk/source/tdb/tdb.h	2004-09-08 02:48:27 UTC (rev 2248)
@@ -32,8 +32,16 @@
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
+#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. 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)
 #endif
+#endif
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1



More information about the samba-cvs mailing list