diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-05-18 11:48:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-05-18 15:45:22 +0900 |
commit | e2ad91fc2094d3cc2f76adc6c55d420cd06f34d8 (patch) | |
tree | 3812b2c7a2377c54c059102c2bcc7329dc2af4be /Rakefile | |
parent | 127f0e286c284812c9cbfe0fe5849d949735f5ef (diff) | |
download | json-e2ad91fc2094d3cc2f76adc6c55d420cd06f34d8.tar.gz |
parser: fix warnings against code generated by ragel
* type-limits when plain-char is unsigned
* unused-const-variable for NFA constants
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |