From e2ad91fc2094d3cc2f76adc6c55d420cd06f34d8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 18 May 2021 11:48:21 +0900 Subject: parser: fix warnings against code generated by ragel * type-limits when plain-char is unsigned * unused-const-variable for NFA constants --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 813a6d9..8de6ded 100644 --- a/Rakefile +++ b/Rakefile @@ -282,7 +282,8 @@ else end src = File.read("parser.c").gsub(/[ \t]+$/, '') src.gsub!(/^static const int (JSON_.*=.*);$/, 'enum {\1};') - src.gsub!(/0 <= \(\*p\) && \(\*p\) <= 31/, "0 <= (signed char)(*p) && (*p) <= 31") + src.gsub!(/^(static const char) (_JSON(?:_\w+)?_nfa_\w+)(?=\[\] =)/, '\1 MAYBE_UNUSED(\2)') + src.gsub!(/0 <= ([\( ]+\*[\( ]*p\)+) && \1 <= 31/, "0 <= (signed char)(*(p)) && (*(p)) <= 31") src[0, 0] = "/* This file is automatically generated from parser.rl by using ragel */" File.open("parser.c", "w") {|f| f.print src} end -- cgit v1.2.1