sas             Thu Aug 28 01:23:08 2003 EDT

  Modified files:              
    /php-src/main       php.h snprintf.h spprintf.h 
  Log:
  Let GCC check format arguments
  
  
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.193 php-src/main/php.h:1.194
--- php-src/main/php.h:1.193    Fri Aug 22 12:43:29 2003
+++ php-src/main/php.h  Thu Aug 28 01:23:08 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php.h,v 1.193 2003/08/22 16:43:29 bfrance Exp $ */
+/* $Id: php.h,v 1.194 2003/08/28 05:23:08 sas Exp $ */
 
 #ifndef PHP_H
 #define PHP_H
@@ -224,6 +224,12 @@
 
 #ifndef LONG_MIN
 #define LONG_MIN (- LONG_MAX - 1)
+#endif
+
+#ifdef __GNUC__
+# define PHP_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, 
first)))
+#else
+# define PHP_ATTRIBUTE_FORMAT(type, idx, first)
 #endif
 
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || PHP_BROKEN_SPRINTF || 
PHP_BROKEN_SNPRINTF || PHP_BROKEN_VSNPRINTF
Index: php-src/main/snprintf.h
diff -u php-src/main/snprintf.h:1.23 php-src/main/snprintf.h:1.24
--- php-src/main/snprintf.h:1.23        Tue Jun 10 16:03:42 2003
+++ php-src/main/snprintf.h     Thu Aug 28 01:23:08 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: snprintf.h,v 1.23 2003/06/10 20:03:42 imajes Exp $ */
+/* $Id: snprintf.h,v 1.24 2003/08/28 05:23:08 sas Exp $ */
 
 /*
 
@@ -65,17 +65,17 @@
 #define SNPRINTF_H
 
 #if !defined(HAVE_SNPRINTF) || PHP_BROKEN_SNPRINTF
-extern int ap_php_snprintf(char *, size_t, const char *, ...);
+int ap_php_snprintf(char *, size_t, const char *, ...) PHP_ATTRIBUTE_FORMAT(printf, 
3, 4);
 #define snprintf ap_php_snprintf
 #endif
 
 #if !defined(HAVE_VSNPRINTF) || PHP_BROKEN_VSNPRINTF
-extern int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
+int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
 #define vsnprintf ap_php_vsnprintf
 #endif
 
 #if PHP_BROKEN_SPRINTF
-int php_sprintf (char* s, const char* format, ...);
+int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
 #define sprintf php_sprintf
 #endif
 
Index: php-src/main/spprintf.h
diff -u php-src/main/spprintf.h:1.8 php-src/main/spprintf.h:1.9
--- php-src/main/spprintf.h:1.8 Tue Jun 10 16:03:42 2003
+++ php-src/main/spprintf.h     Thu Aug 28 01:23:08 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spprintf.h,v 1.8 2003/06/10 20:03:42 imajes Exp $ */
+/* $Id: spprintf.h,v 1.9 2003/08/28 05:23:08 sas Exp $ */
 
 /* 
 
@@ -37,9 +37,9 @@
 #include "snprintf.h"
 
 BEGIN_EXTERN_C()
-PHPAPI extern int spprintf( char **pbuf, size_t max_len, const char *format, ...);
+PHPAPI int spprintf( char **pbuf, size_t max_len, const char *format, ...) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
 
-PHPAPI extern int vspprintf(char **pbuf, size_t max_len, const char *format, va_list 
ap);
+PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
 END_EXTERN_C()
 
 #endif /* SNPRINTF_H */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to