sas Thu Aug 28 01:25:27 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/main php.h snprintf.h spprintf.h
Log:
MFH automatic format checks
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.178.2.4 php-src/main/php.h:1.178.2.5
--- php-src/main/php.h:1.178.2.4 Fri Jun 27 03:43:05 2003
+++ php-src/main/php.h Thu Aug 28 01:25:26 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.178.2.4 2003/06/27 07:43:05 sas Exp $ */
+/* $Id: php.h,v 1.178.2.5 2003/08/28 05:25:26 sas Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -218,6 +218,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.18.4.2 php-src/main/snprintf.h:1.18.4.3
--- php-src/main/snprintf.h:1.18.4.2 Tue Feb 25 04:45:47 2003
+++ php-src/main/snprintf.h Thu Aug 28 01:25:26 2003
@@ -63,17 +63,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.5.4.1 php-src/main/spprintf.h:1.5.4.2
--- php-src/main/spprintf.h:1.5.4.1 Tue Dec 31 11:26:27 2002
+++ php-src/main/spprintf.h Thu Aug 28 01:25:26 2003
@@ -35,9 +35,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