Skip to content

Commit 9b204bb

Browse files
committed
Attempt to fix _Pragma error on older gcc versions
1 parent 14fbb44 commit 9b204bb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/soap/php_encoding.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,9 +2386,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23862386
if (style == SOAP_ENCODED) {
23872387
if (soap_version == SOAP_1_1) {
23882388
smart_str_0(&array_type);
2389+
#if defined(__GNUC__) && __GNUC__ >= 11
23892390
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2390-
if (strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0) {
2391-
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2391+
#endif
2392+
bool isXsdAnyType = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
2393+
#if defined(__GNUC__) && __GNUC__ >= 11
2394+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2395+
#endif
2396+
if (isXsdAnyType) {
23922397
smart_str_free(&array_type);
23932398
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
23942399
}

0 commit comments

Comments
 (0)