Skip to content

Commit f271b5c

Browse files
committed
Use nonstring attribute only on GCC 15
`__has_attribute` does not seem reliable.
1 parent ce51ef3 commit f271b5c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/ruby/internal/attr/nonstring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "ruby/internal/has/attribute.h"
2424

2525
/** Wraps (or simulates) `__attribute__((nonstring))` */
26-
#if RBIMPL_HAS_ATTRIBUTE(nonstring)
26+
#if RBIMPL_COMPILER_SINCE(GCC, 15, 0, 0)
2727
# define RBIMPL_ATTR_NONSTRING() __attribute__((nonstring))
2828
#else
2929
# define RBIMPL_ATTR_NONSTRING() /* void */

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() static const char id_types[][8] = {
176176
"local",
177177
"instance",
178178
"invalid",

0 commit comments

Comments
 (0)