Skip to content

Commit b6fc00d

Browse files
committed
Back-port newer ZEND_DIAGNOSTIC_IGNORED_(START|END) macro instead
1 parent 54fa288 commit b6fc00d

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

Zend/zend_portability.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -685,17 +685,28 @@ extern "C++" {
685685
# define ZEND_INDIRECT_RETURN
686686
#endif
687687

688-
#if __GNUC__ && !defined(__clang__)
689-
# define __DO_PRAGMA(x) _Pragma(#x)
690-
# define _DO_PRAGMA(x) __DO_PRAGMA(x)
691-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning) \
688+
#define __ZEND_DO_PRAGMA(x) _Pragma(#x)
689+
#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x)
690+
#if defined(__clang__)
691+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
692+
_Pragma("clang diagnostic push") \
693+
_ZEND_DO_PRAGMA(clang diagnostic ignored warning)
694+
# define ZEND_DIAGNOSTIC_IGNORED_END \
695+
_Pragma("clang diagnostic pop")
696+
#elif defined(__GNUC__)
697+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
692698
_Pragma("GCC diagnostic push") \
693-
_DO_PRAGMA(GCC diagnostic ignored warning)
694-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END \
699+
_ZEND_DO_PRAGMA(GCC diagnostic ignored warning)
700+
# define ZEND_DIAGNOSTIC_IGNORED_END \
695701
_Pragma("GCC diagnostic pop")
696702
#else
697-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning)
698-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END
703+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning)
704+
# define ZEND_DIAGNOSTIC_IGNORED_END
699705
#endif
700706

707+
/** @deprecated */
708+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_START ZEND_DIAGNOSTIC_IGNORED_START
709+
/** @deprecated */
710+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
711+
701712
#endif /* ZEND_PORTABILITY_H */

ext/imap/php_imap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
# endif
4848

4949
/* these are used for quota support */
50-
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
50+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5151
# include "c-client.h" /* includes mail.h and rfc822.h */
52-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
52+
ZEND_DIAGNOSTIC_IGNORED_END
5353
# include "imap4r1.h" /* location of c-client quota functions */
5454
#else
5555
# include "mail.h"

ext/oci8/php_oci8_int.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
/* }}} */
5454

5555
#include "ext/standard/php_string.h"
56-
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
56+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5757
#include <oci.h>
58-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
58+
ZEND_DIAGNOSTIC_IGNORED_END
5959

6060
extern int le_connection;
6161
extern int le_pconnection;

ext/pdo_oci/php_pdo_oci_int.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
#include "zend_portability.h"
2121

22-
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
22+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
2323
#include <oci.h>
24-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
24+
ZEND_DIAGNOSTIC_IGNORED_END
2525

2626
typedef struct {
2727
const char *file;

ext/soap/php_encoding.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,11 +2389,11 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23892389
if (soap_version == SOAP_1_1) {
23902390
smart_str_0(&array_type);
23912391
#if defined(__GNUC__) && __GNUC__ >= 11
2392-
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2392+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
23932393
#endif
23942394
bool is_xsd_any_type = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
23952395
#if defined(__GNUC__) && __GNUC__ >= 11
2396-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2396+
ZEND_DIAGNOSTIC_IGNORED_END
23972397
#endif
23982398
if (is_xsd_any_type) {
23992399
smart_str_free(&array_type);

0 commit comments

Comments
 (0)