mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
Disable format string checking by default
Instead of removing format attributes altogether, disable the checks by default. This allows you to do a build with format string checks and filter out the false positives (basically anything mentioning %p).
This commit is contained in:
parent
fdd1e96f3e
commit
979058d4ff
@ -159,13 +159,17 @@ char *alloca ();
|
||||
# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
|
||||
#endif
|
||||
|
||||
#if ZEND_GCC_VERSION >= 2007
|
||||
/* Format string checks are disabled by default, because we use custom format modifiers (like %p),
|
||||
* which cause a large amount of false positives. You can enable format checks by adding
|
||||
* -DZEND_CHECK_FORMAT_STRINGS to CFLAGS. */
|
||||
|
||||
#if ZEND_GCC_VERSION >= 2007 && defined(ZEND_CHECK_FORMAT_STRINGS)
|
||||
# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
|
||||
#else
|
||||
# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
|
||||
#endif
|
||||
|
||||
#if ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)
|
||||
#if ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER) && defined(ZEND_CHECK_FORMAT_STRINGS)
|
||||
# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
|
||||
#else
|
||||
# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)
|
||||
|
Loading…
Reference in New Issue
Block a user