summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-04-30 18:35:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2025-04-30 20:04:10 +0900
commitb42afa1dbcbb91e89852b3b3bc72484d7f0a5528 (patch)
tree8f60ba422056d6324f303245f327c84e0fc5da7b /template
parent545aafa2a27d433c3282ab10e95011dee5c63835 (diff)
Suppress gcc 15 unterminated-string-initialization warnings
Diffstat (limited to 'template')
-rw-r--r--template/id.c.tmpl3
-rw-r--r--template/prelude.c.tmpl5
2 files changed, 5 insertions, 3 deletions
diff --git a/template/id.c.tmpl b/template/id.c.tmpl
index 5b9e879730..5aa8e47ce7 100644
--- a/template/id.c.tmpl
+++ b/template/id.c.tmpl
@@ -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
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index 675973b913..04f65ec5e3 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -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