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

@ -22,7 +22,8 @@ ops = ids[:token_op].uniq {|id, op, token| token && op}
static const struct {
unsigned short token;
const char name[3], term;
RBIMPL_ATTR_NONSTRING() const char name[3];
const char term;
} op_tbl[] = {
% ops.each do |_id, op, token|
% next unless token

View file

@ -88,6 +88,7 @@ Prelude.new(output, ARGV, vpath).instance_eval do
#include "internal/ruby_parser.h"
#include "internal/warnings.h"
#include "iseq.h"
#include "ruby/internal/attr/nonstring.h"
#include "ruby/ruby.h"
#include "vm_core.h"
@ -107,12 +108,12 @@ static const struct {
% size += line.size
% next
% end
char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=n%> */
RBIMPL_ATTR_NONSTRING() char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=n%> */
% size = line.size
% beg = n
% }
% if size > 0
char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=lines.size+1%> */
RBIMPL_ATTR_NONSTRING() char L<%=beg%><%=%>[<%=size%><%=%>]; /* <%=beg+1%>..<%=lines.size+1%> */
% end
} prelude_code<%=i%><%=%> = {
% size = 0