summaryrefslogtreecommitdiff
path: root/main/php.h
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2011-05-16 16:58:02 +0000
committerRasmus Lerdorf <rasmus@php.net>2011-05-16 16:58:02 +0000
commit75ec1fedc7532b4743bedc1ec4881d90b7d71452 (patch)
treefe00077f710f0f357548deb62f9c82d63bfb270b /main/php.h
parent27dd44db9577f09864cb231b0e1e58efe9a14230 (diff)
downloadphp-git-75ec1fedc7532b4743bedc1ec4881d90b7d71452.tar.gz
Add php_ignore_value() macro to suppress unused return value warnings
from gcc. There are times when we really don't care about the return value and this will cleanly tell gcc.
Diffstat (limited to 'main/php.h')
-rw-r--r--main/php.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/php.h b/main/php.h
index d338462eae..278d6390fb 100644
--- a/main/php.h
+++ b/main/php.h
@@ -259,6 +259,11 @@ END_EXTERN_C()
# endif
#endif
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define php_ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define php_ignore_value(x) ((void) (x))
+#endif
/* global variables */
#if !defined(PHP_WIN32)