mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Suppress gcc 15 unterminated-string-initialization warnings
This commit is contained in:
parent
32bfb61d34
commit
dedf9f5f62
2 changed files with 3 additions and 1 deletions
3
file.c
3
file.c
|
@ -12,6 +12,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/internal/config.h"
|
||||
#include "ruby/internal/attr/nonstring.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "missing/file.h"
|
||||
|
@ -373,7 +374,7 @@ rb_str_normalize_ospath(const char *ptr, long len)
|
|||
int r = rb_enc_precise_mbclen(p, e, enc);
|
||||
if (!MBCLEN_CHARFOUND_P(r)) {
|
||||
/* invalid byte shall not happen but */
|
||||
static const char invalid[3] = "\xEF\xBF\xBD";
|
||||
RBIMPL_ATTR_NONSTRING() static const char invalid[3] = "\xEF\xBF\xBD";
|
||||
rb_str_append_normalized_ospath(str, p1, p-p1);
|
||||
rb_str_cat(str, invalid, sizeof(invalid));
|
||||
p += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue