com php-src: Revert "remove a few gcc format attributes from some printf-like functions": main/php.h main/php_streams.h mai n/snprintf.h
main/spprintf.h
| From: | Nikita Popov | Date: | Wed, 03 Sep 2014 13:22:08 +0000 |
| Subject: | com php-src: Revert "remove a few gcc format attributes from some printf-like functions": main/php.h main/php_streams.h mai n/snprintf.h main/spprintf.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81404@lists.php.net to get a copy of this message | ||
Commit: fdd1e96f3e90895134c4082bde8cad475378deac
Author: Nikita Popov <nikic@php.net> Wed, 3 Sep 2014 15:22:08 +0200
Parents: 9e753531842f524a1a147ca0244c041e59ecd117
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fdd1e96f3e90895134c4082bde8cad475378deac
Log:
Revert "remove a few gcc format attributes from some printf-like functions"
This reverts commit 25f5ba94aca1e89ee5f0c66513e58826afa3b853.
Changed paths:
M main/php.h
M main/php_streams.h
M main/snprintf.h
M main/spprintf.h
Diff:
diff --git a/main/php.h b/main/php.h
index 47e1e10..11a8a64 100644
--- a/main/php.h
+++ b/main/php.h
@@ -281,9 +281,12 @@ ssize_t pread(int, void *, size_t, off64_t);
BEGIN_EXTERN_C()
void phperror(char *error);
PHPAPI size_t php_write(void *buf, size_t size TSRMLS_DC);
-PHPAPI size_t php_printf(const char *format, ...);
+PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1,
+ 2);
PHPAPI int php_get_module_initialized(void);
PHPAPI void php_log_err(char *log_message TSRMLS_DC);
+int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
+int cfgparse(void);
END_EXTERN_C()
#define php_error zend_error
@@ -305,9 +308,12 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const
c
#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);
#ifdef PHP_WIN32
PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2
TSRMLS_DC);
#endif
diff --git a/main/php_streams.h b/main/php_streams.h
index ecc6557..9a6e84d 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -299,9 +299,9 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_
#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size)
TSRMLS_CC)
#ifdef ZTS
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...);
+PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...)
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...);
+PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...)
PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
#endif
/* php_stream_printf macro & function require TSRMLS_CC */
@@ -560,9 +560,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS
/* pushes an error message onto the stack for a wrapper instance */
#ifdef ZTS
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const
char *fmt, ...);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const
char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
#else
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const
char *fmt, ...);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const
char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#endif
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
diff --git a/main/snprintf.h b/main/snprintf.h
index 98742e0..6cef41f 100644
--- a/main/snprintf.h
+++ b/main/snprintf.h
@@ -84,7 +84,7 @@ PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...);
PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
PHPAPI int ap_php_asprintf(char **buf, const char *format, ...);
-PHPAPI int php_sprintf (char* s, const char* format, ...);
+PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf);
PHPAPI char * php_conv_fp(register char format, register double num,
boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, size_t
*len);
diff --git a/main/spprintf.h b/main/spprintf.h
index 70e4b0d..1e47828 100644
--- a/main/spprintf.h
+++ b/main/spprintf.h
@@ -37,9 +37,9 @@ There is also snprintf: See difference explained in snprintf.h
#include "snprintf.h"
BEGIN_EXTERN_C()
-PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...);
+PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap);
+PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap)
PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
PHPAPI zend_string *vstrpprintf(size_t max_len, const char *format, va_list ap);