sas Thu Aug 28 12:49:43 2003 EDT
Modified files:
/php-src/main php.h
Log:
add format attribute where appropiate
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.195 php-src/main/php.h:1.196
--- php-src/main/php.h:1.195 Thu Aug 28 10:53:36 2003
+++ php-src/main/php.h Thu Aug 28 12:49:43 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.195 2003/08/28 14:53:36 sas Exp $ */
+/* $Id: php.h,v 1.196 2003/08/28 16:49:43 sas Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -228,12 +228,7 @@
#define PHP_GCC_VERSION ZEND_GCC_VERSION
#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC
-
-#if PHP_GCC_VERSION >= 2007
-# define PHP_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx,
first)))
-#else
-# define PHP_ATTRIBUTE_FORMAT(type, idx, first)
-#endif
+#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || PHP_BROKEN_SPRINTF ||
PHP_BROKEN_SNPRINTF || PHP_BROKEN_VSNPRINTF
#include "snprintf.h"
@@ -284,9 +279,10 @@
BEGIN_EXTERN_C();
void phperror(char *error);
PHPAPI int php_write(void *buf, uint size TSRMLS_DC);
-PHPAPI int php_printf(const char *format, ...);
+PHPAPI int php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1,
+ 2);
PHPAPI void php_log_err(char *log_message TSRMLS_DC);
-int Debug(char *format, ...);
+int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
int cfgparse(void);
END_EXTERN_C();
@@ -301,12 +297,21 @@
BEGIN_EXTERN_C();
PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry
*exception_class TSRMLS_DC);
-PHPAPI void php_verror(const char *docref, const char *params, int type, const char
*format, va_list args TSRMLS_DC) ;
+PHPAPI void php_verror(const char *docref, const char *params, int type, const char
*format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
+
+#ifdef ZTS
+#define PHP_ATTR_FMT_OFFSET 1
+#else
+#define PHP_ATTR_FMT_OFFSET 0
+#endif
/* PHPAPI void php_error(int type, const char *format, ...); */
-PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char
*format, ...);
-PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int
type, const char *format, ...);
-PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const
char *param2, int type, const char *format, ...);
+PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char
*format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4);
+PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int
type, const char *format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5);
+PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const
char *param2, int type, const char *format, ...)
+ PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6);
END_EXTERN_C();
#define php_error_docref php_error_docref0
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php