Skip to content

Commit 4c4ceb9

Browse files
ndosschejmarble
authored andcommitted
Fix phpGH-20492: mbstring compile warning due to non-strings
This is a partial backport of ea69276, but without changing public headers as that's not allowed at this point. Closes phpGH-20494.
1 parent b6bab18 commit 4c4ceb9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ PHP NEWS
3737
- MbString:
3838
. Fixed bug GH-20491 (SLES15 compile error with mbstring oniguruma).
3939
(ndossche)
40+
. Fixed bug GH-20492 (mbstring compile warning due to non-strings).
41+
(ndossche)
4042

4143
- Opcache:
4244
. Fixed bug GH-20329 (opcache.file_cache broken with full interned string

ext/mbstring/libmbfl/filters/mbfilter_cjk.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
* This macro converts uppercase ASCII values to Regional Indicator codepoints */
2222
#define NFLAGS(c) (0x1F1A5+((unsigned int)(c)))
2323

24+
#if __has_attribute(nonstring) && defined(__GNUC__) && ((!defined(__clang__) && __GNUC__ >= 15) || (defined(__clang_major__) && __clang_major__ >= 20))
25+
# define ZEND_NONSTRING __attribute__((nonstring))
26+
#else
27+
# define ZEND_NONSTRING
28+
#endif
29+
30+
2431
static const char nflags_s[10][2] ZEND_NONSTRING = {"CN", "DE", "ES", "FR", "GB", "IT", "JP", "KR", "RU", "US"};
2532
static const int nflags_code_kddi[10] = { 0x2549, 0x2546, 0x24C0, 0x2545, 0x2548, 0x2547, 0x2750, 0x254A, 0x24C1, 0x27F7 };
2633
static const int nflags_code_sb[10] = { 0x2B0A, 0x2B05, 0x2B08, 0x2B04, 0x2B07, 0x2B06, 0x2B02, 0x2B0B, 0x2B09, 0x2B03 };

0 commit comments

Comments
 (0)