Skip to content

Commit adee760

Browse files
committed
Use __attribute__((assume())) in ZEND_ASSUME when available
1 parent 4091d24 commit adee760

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_portability.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989

9090
#if defined(ZEND_WIN32) && !defined(__clang__)
9191
# define ZEND_ASSUME(c) __assume(c)
92+
#elif defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 13
93+
/* GCC emits a warning when __attribute__ appears directly after a label, so prefix with ;. */
94+
# define ZEND_ASSUME(c) ;__attribute__((assume(c)))
9295
#elif defined(__clang__) && __has_builtin(__builtin_assume)
9396
# pragma clang diagnostic ignored "-Wassume"
9497
# define ZEND_ASSUME(c) __builtin_assume(c)

0 commit comments

Comments
 (0)