Skip to content

Commit 94c1e55

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Implement diagnostic ignore macro for Clang
2 parents f39b5c4 + 80b4c73 commit 94c1e55

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
@@ -743,19 +743,30 @@ extern "C++" {
743743
# define ZEND_INDIRECT_RETURN
744744
#endif
745745

746-
#if __GNUC__ && !defined(__clang__)
747-
# define __DO_PRAGMA(x) _Pragma(#x)
748-
# define _DO_PRAGMA(x) __DO_PRAGMA(x)
749-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning) \
746+
#define __ZEND_DO_PRAGMA(x) _Pragma(#x)
747+
#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x)
748+
#if defined(__clang__)
749+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
750+
_Pragma("clang diagnostic push") \
751+
_ZEND_DO_PRAGMA(clang diagnostic ignored warning)
752+
# define ZEND_DIAGNOSTIC_IGNORED_END \
753+
_Pragma("clang diagnostic pop")
754+
#elif defined(__GNUC__)
755+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
750756
_Pragma("GCC diagnostic push") \
751-
_DO_PRAGMA(GCC diagnostic ignored warning)
752-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END \
757+
_ZEND_DO_PRAGMA(GCC diagnostic ignored warning)
758+
# define ZEND_DIAGNOSTIC_IGNORED_END \
753759
_Pragma("GCC diagnostic pop")
754760
#else
755-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning)
756-
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END
761+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning)
762+
# define ZEND_DIAGNOSTIC_IGNORED_END
757763
#endif
758764

765+
/** @deprecated */
766+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_START ZEND_DIAGNOSTIC_IGNORED_START
767+
/** @deprecated */
768+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
769+
759770
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
760771
# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
761772
#else

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
#if !defined(OCI_MAJOR_VERSION) || OCI_MAJOR_VERSION < 11 || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION < 2))
6161
#error This version of PHP OCI8 requires Oracle Client libraries from 11.2 or later.

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
@@ -2387,11 +2387,11 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23872387
if (soap_version == SOAP_1_1) {
23882388
smart_str_0(&array_type);
23892389
#if defined(__GNUC__) && __GNUC__ >= 11
2390-
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2390+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
23912391
#endif
23922392
bool is_xsd_any_type = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
23932393
#if defined(__GNUC__) && __GNUC__ >= 11
2394-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2394+
ZEND_DIAGNOSTIC_IGNORED_END
23952395
#endif
23962396
if (is_xsd_any_type) {
23972397
smart_str_free(&array_type);

0 commit comments

Comments
 (0)