Suppress gcc 15 unterminated-string-initialization warnings

This commit is contained in:
Nobuyoshi Nakada 2025-04-30 18:35:25 +09:00 committed by Hiroshi SHIBATA
parent 7e6bbc40c8
commit e26e8423b5
11 changed files with 57 additions and 7 deletions

View file

@ -45,6 +45,7 @@
#include "ruby/util.h"
#include "ruby_assert.h"
#include "vm_sync.h"
#include "ruby/internal/attr/nonstring.h"
#if defined HAVE_CRYPT_R
# if defined HAVE_CRYPT_H
@ -10993,7 +10994,7 @@ enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl, int cr)
encidx = rb_enc_to_index(enc);
#define DEFAULT_REPLACE_CHAR(str) do { \
static const char replace[sizeof(str)-1] = str; \
RBIMPL_ATTR_NONSTRING() static const char replace[sizeof(str)-1] = str; \
rep = replace; replen = (int)sizeof(replace); \
} while (0)