summaryrefslogtreecommitdiff
path: root/Zend/zend_portability.h
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-11-16 12:29:27 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-11-16 21:15:36 +0100
commit26f8fc833b9668a8b8e14ecd7d94930146019adb (patch)
treebd94fe2e87a8f1da483d7644b1d3a3f0091e1637 /Zend/zend_portability.h
parentb8a4225a5f9d2bbe7aeb4cabce659bc903f162f6 (diff)
downloadphp-git-26f8fc833b9668a8b8e14ecd7d94930146019adb.tar.gz
Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for cases where we specifically want to disable these checks, such as use of %H.
Diffstat (limited to 'Zend/zend_portability.h')
-rw-r--r--Zend/zend_portability.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index ec140b3f54..0b5e8fa0a7 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -197,17 +197,13 @@ char *alloca();
# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
#endif
-/* 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 defined(ZEND_CHECK_FORMAT_STRINGS) && (ZEND_GCC_VERSION >= 2007 || __has_attribute(format))
+#if ZEND_GCC_VERSION >= 2007 || __has_attribute(format)
# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
#else
# define ZEND_ATTRIBUTE_FORMAT(type, idx, first)
#endif
-#if defined(ZEND_CHECK_FORMAT_STRINGS) && ((ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)) || __has_attribute(format))
+#if (ZEND_GCC_VERSION >= 3001 && !defined(__INTEL_COMPILER)) || __has_attribute(format)
# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
#else
# define ZEND_ATTRIBUTE_PTR_FORMAT(type, idx, first)