Suppress gcc 15 unterminated-string-initialization warnings

This commit is contained in:
Nobuyoshi Nakada 2025-04-30 18:35:25 +09:00
parent 545aafa2a2
commit b42afa1dbc
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
12 changed files with 59 additions and 8 deletions

View file

@ -40,6 +40,7 @@
#include "ruby/util.h"
#include "builtin.h"
#include "shape.h"
#include "ruby/internal/attr/nonstring.h"
#define BITSPERSHORT (2*CHAR_BIT)
#define SHORTMASK ((1<<BITSPERSHORT)-1)
@ -1515,7 +1516,7 @@ name_equal(const char *name, size_t nlen, const char *p, long l)
static int
sym2encidx(VALUE sym, VALUE val)
{
static const char name_encoding[8] = "encoding";
RBIMPL_ATTR_NONSTRING() static const char name_encoding[8] = "encoding";
const char *p;
long l;
if (rb_enc_get_index(sym) != ENCINDEX_US_ASCII) return -1;