Skip to content

Commit bbf1130

Browse files
committed
Add RBIMPL_ATTR_NONSTRING_ARRAY() macro for GCC 15
1 parent ce51ef3 commit bbf1130

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

enc/trans/iso2022.trans

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ rb_cp50221_encoder = {
437437

438438
/* JIS0201 to JIS0208 conversion table */
439439
enum {tbl0208_num = 0xDF - 0xA1 + 1};
440-
RBIMPL_ATTR_NONSTRING() static const char tbl0208[tbl0208_num][2] = {
440+
RBIMPL_ATTR_NONSTRING_ARRAY() static const char tbl0208[tbl0208_num][2] = {
441441
"\x21\x23", "\x21\x56", "\x21\x57", "\x21\x22",
442442
"\x21\x26", "\x25\x72", "\x25\x21", "\x25\x23",
443443
"\x25\x25", "\x25\x27", "\x25\x29", "\x25\x63",

include/ruby/internal/attr/nonstring.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@
2525
/** Wraps (or simulates) `__attribute__((nonstring))` */
2626
#if RBIMPL_HAS_ATTRIBUTE(nonstring)
2727
# define RBIMPL_ATTR_NONSTRING() __attribute__((nonstring))
28+
# if RBIMPL_COMPILER_SINCE(GCC, 15, 0, 0)
29+
# define RBIMPL_ATTR_NONSTRING_ARRAY() RBIMPL_ATTR_NONSTRING()
30+
# else
31+
# define RBIMPL_ATTR_NONSTRING_ARRAY() /* void */
32+
# endif
2833
#else
2934
# define RBIMPL_ATTR_NONSTRING() /* void */
35+
# define RBIMPL_ATTR_NONSTRING_ARRAY() /* void */
3036
#endif
3137

3238
#endif /* RBIMPL_ATTR_NONSTRING_H */

symbol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ rb_id_attrset(ID id)
172172

173173
/* make new symbol and ID */
174174
if (!(str = lookup_id_str(id))) {
175-
static const char id_types[][8] = {
175+
RBIMPL_ATTR_NONSTRING_ARRAY() static const char id_types[][8] = {
176176
"local",
177177
"instance",
178178
"invalid",

0 commit comments

Comments
 (0)