From: Ulya Trofimovich Date: Wed, 9 Nov 2016 23:05:00 +0000 (+0000) Subject: Moved '-Wundefined-control-flow' analysis to the point of skeleton generation. X-Git-Tag: 1.0~39^2~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c57b8d21bf2910261b5126c608bcc39268aa223a;p=re2c Moved '-Wundefined-control-flow' analysis to the point of skeleton generation. --- diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index ad9260a4..06222822 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -178,8 +178,6 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra head->action.set_initial (initial_label, head->action.type == Action::SAVE); - warn_undefined_control_flow(*skeleton); - if (opts->target == opt_t::SKELETON) { if (output.skeletons.insert (name).second) { diff --git a/re2c/src/ir/compile.cc b/re2c/src/ir/compile.cc index 3fc52f7c..fecdc5c9 100644 --- a/re2c/src/ir/compile.cc +++ b/re2c/src/ir/compile.cc @@ -63,6 +63,7 @@ static smart_ptr compile_rules( // skeleton must be constructed after DFA construction // but prior to any other DFA transformations Skeleton *skeleton = new Skeleton(dfa, cs, defrule, name, cond, line); + warn_undefined_control_flow(*skeleton); if (opts->target == opt_t::SKELETON) { emit_data(*skeleton); } diff --git a/re2c/test/bug61.i--empty-class(match-none).c b/re2c/test/bug61.i--empty-class(match-none).c index 023d2274..32db5143 100644 --- a/re2c/test/bug61.i--empty-class(match-none).c +++ b/re2c/test/bug61.i--empty-class(match-none).c @@ -29,21 +29,21 @@ } re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 6: empty character class [-Wempty-character-class] -re2c: warning: line 6: unreachable rule [-Wunreachable-rules] re2c: warning: line 7: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 6: unreachable rule [-Wunreachable-rules] re2c: warning: line 10: empty character class [-Wempty-character-class] -re2c: warning: line 10: unreachable rule [-Wunreachable-rules] re2c: warning: line 11: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: unreachable rule [-Wunreachable-rules] re2c: warning: line 14: empty character class [-Wempty-character-class] re2c: warning: line 14: empty character class [-Wempty-character-class] re2c: warning: line 14: empty character class [-Wempty-character-class] -re2c: warning: line 14: unreachable rule [-Wunreachable-rules] re2c: warning: line 15: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: unreachable rule [-Wunreachable-rules] re2c: warning: line 18: empty character class [-Wempty-character-class] re2c: warning: line 18: empty character class [-Wempty-character-class] re2c: warning: line 18: empty character class [-Wempty-character-class] -re2c: warning: line 18: unreachable rule [-Wunreachable-rules] re2c: warning: line 19: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 18: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-none).c b/re2c/test/bug61_difference_full.i--empty-class(match-none).c index cae24e18..1062a8ca 100644 --- a/re2c/test/bug61_difference_full.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_full.i--empty-class(match-none).c @@ -5,5 +5,5 @@ } re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-none).c b/re2c/test/bug61_difference_negative.i--empty-class(match-none).c index 28e06b11..77d6d3ce 100644 --- a/re2c/test/bug61_difference_negative.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_negative.i--empty-class(match-none).c @@ -7,5 +7,5 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-none).c b/re2c/test/bug61_difference_positive.i--empty-class(match-none).c index 28e06b11..77d6d3ce 100644 --- a/re2c/test/bug61_difference_positive.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_positive.i--empty-class(match-none).c @@ -7,5 +7,5 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/bug61_negative.i--empty-class(match-none).c b/re2c/test/bug61_negative.i--empty-class(match-none).c index cae24e18..1062a8ca 100644 --- a/re2c/test/bug61_negative.i--empty-class(match-none).c +++ b/re2c/test/bug61_negative.i--empty-class(match-none).c @@ -5,5 +5,5 @@ } re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/bug61_positive.i--empty-class(match-none).c b/re2c/test/bug61_positive.i--empty-class(match-none).c index cae24e18..1062a8ca 100644 --- a/re2c/test/bug61_positive.i--empty-class(match-none).c +++ b/re2c/test/bug61_positive.i--empty-class(match-none).c @@ -5,5 +5,5 @@ } re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 2: unreachable rule [-Wunreachable-rules] re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 2: unreachable rule [-Wunreachable-rules] diff --git a/re2c/test/repeat-01.cgir--skeleton.c b/re2c/test/repeat-01.cgir--skeleton.c index c84f2b4e..770df780 100644 --- a/re2c/test/repeat-01.cgir--skeleton.c +++ b/re2c/test/repeat-01.cgir--skeleton.c @@ -354,7 +354,3 @@ int main()  !"#$%&'()*+,-./03456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`cdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ12b  !"#$%&'()*+,-./03456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`acdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿre2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-01.cgir.c b/re2c/test/repeat-01.cgir.c index 1a809001..5618c966 100644 --- a/re2c/test/repeat-01.cgir.c +++ b/re2c/test/repeat-01.cgir.c @@ -192,7 +192,3 @@ yy19: re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-02.cgir--skeleton.c b/re2c/test/repeat-02.cgir--skeleton.c index 67689e69..6892278a 100644 --- a/re2c/test/repeat-02.cgir--skeleton.c +++ b/re2c/test/repeat-02.cgir--skeleton.c @@ -354,7 +354,3 @@ int main()  !"#$%&'()*+,-./03456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`cdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ12b  !"#$%&'()*+,-./03456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`acdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿre2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-02.cgir.c b/re2c/test/repeat-02.cgir.c index 62379b0d..d3fa94d8 100644 --- a/re2c/test/repeat-02.cgir.c +++ b/re2c/test/repeat-02.cgir.c @@ -192,7 +192,3 @@ yy19: re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] -re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-03.cgir--skeleton.c b/re2c/test/repeat-03.cgir--skeleton.c index 1feb5365..c325269b 100644 --- a/re2c/test/repeat-03.cgir--skeleton.c +++ b/re2c/test/repeat-03.cgir--skeleton.c @@ -716,7 +716,9 @@ int main() ÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿac ÿ  !"#$%&'()*+,-./013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`defghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ2abc ÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿac -ÿre2c: warning: line 18: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +ÿre2c: warning: line 14: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 18: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 18: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 28: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 28: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-03.cgir.c b/re2c/test/repeat-03.cgir.c index 15730381..233b6c4d 100644 --- a/re2c/test/repeat-03.cgir.c +++ b/re2c/test/repeat-03.cgir.c @@ -189,6 +189,8 @@ yy21: } } +re2c: warning: line 14: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 18: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 18: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 28: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-06.gir--skeleton.c b/re2c/test/repeat-06.gir--skeleton.c index abbef45b..2dc07e38 100644 --- a/re2c/test/repeat-06.gir--skeleton.c +++ b/re2c/test/repeat-06.gir--skeleton.c @@ -620,6 +620,7 @@ abcd  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  !"#$%&'()*+,-./023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ1abcd ÿ  !"#$%&'()*+,-./013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ2abcd ÿ  !"#$%&'()*+,-./012456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ3abcd -ÿre2c: warning: line 24: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +ÿre2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 24: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 39: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 54: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-06.gir.c b/re2c/test/repeat-06.gir.c index 5f3b2e51..106d7f14 100644 --- a/re2c/test/repeat-06.gir.c +++ b/re2c/test/repeat-06.gir.c @@ -201,6 +201,7 @@ yy13: } } +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 24: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 39: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 54: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-07.gir.c b/re2c/test/repeat-07.gir.c index 41962d28..5e01b0c9 100644 --- a/re2c/test/repeat-07.gir.c +++ b/re2c/test/repeat-07.gir.c @@ -205,6 +205,7 @@ yy13: } } +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 27: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 45: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 63: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/repeat-07_error.gir.c b/re2c/test/repeat-07_error.gir.c index f90a68be..93f46cad 100644 --- a/re2c/test/repeat-07_error.gir.c +++ b/re2c/test/repeat-07_error.gir.c @@ -1,3 +1,4 @@ +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 27: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 45: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 52, column 1: Cannot set UTF32 encoding: please reset USC2 encoding first diff --git a/re2c/test/reuse_conds_default_0.cgir--skeleton.c b/re2c/test/reuse_conds_default_0.cgir--skeleton.c index 66c61d36..2f56a23e 100644 --- a/re2c/test/reuse_conds_default_0.cgir--skeleton.c +++ b/re2c/test/reuse_conds_default_0.cgir--skeleton.c @@ -721,5 +721,7 @@ int main() 1abcþ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿac ÿ  !"#$%&'()*+,-./013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`defghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ2abc ÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ -acþre2c: warning: line 15: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +acþre2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 20: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/reuse_conds_default_0.cgir.c b/re2c/test/reuse_conds_default_0.cgir.c index ae287d7e..f9a89c9d 100644 --- a/re2c/test/reuse_conds_default_0.cgir.c +++ b/re2c/test/reuse_conds_default_0.cgir.c @@ -183,6 +183,8 @@ yy22: { return "c"; } } +re2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 15: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 20: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 15: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] diff --git a/re2c/test/reuse_conds_default_1.cgir--skeleton.c b/re2c/test/reuse_conds_default_1.cgir--skeleton.c index 1602c7f4..80976bfd 100644 --- a/re2c/test/reuse_conds_default_1.cgir--skeleton.c +++ b/re2c/test/reuse_conds_default_1.cgir--skeleton.c @@ -724,4 +724,5 @@ abc 1abcþ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ acþ  !"#$%&'()*+,-./013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`defghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 2abcþ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿac -ÿre2c: warning: line 32: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +ÿre2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 32: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/reuse_conds_default_1.cgir.c b/re2c/test/reuse_conds_default_1.cgir.c index 500f734b..2263ab34 100644 --- a/re2c/test/reuse_conds_default_1.cgir.c +++ b/re2c/test/reuse_conds_default_1.cgir.c @@ -193,4 +193,5 @@ yy22: } } +re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 32: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/reuse_conds_setup_0.cgir.c b/re2c/test/reuse_conds_setup_0.cgir.c index 8d084737..47807d22 100644 --- a/re2c/test/reuse_conds_setup_0.cgir.c +++ b/re2c/test/reuse_conds_setup_0.cgir.c @@ -1 +1,3 @@ +re2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 13, column 9: code to setup rule 'r1' is already defined diff --git a/re2c/test/reuse_conds_setup_1.cgir.c b/re2c/test/reuse_conds_setup_1.cgir.c index e927119a..f39bb25e 100644 --- a/re2c/test/reuse_conds_setup_1.cgir.c +++ b/re2c/test/reuse_conds_setup_1.cgir.c @@ -1 +1,3 @@ +re2c: warning: line 17: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 11, column 9: code to setup rule 'r1' is already defined diff --git a/re2c/test/rexx.--empty-class(match-none).c b/re2c/test/rexx.--empty-class(match-none).c index 16c951c5..b7bbd8a3 100644 --- a/re2c/test/rexx.--empty-class(match-none).c +++ b/re2c/test/rexx.--empty-class(match-none).c @@ -6885,8 +6885,8 @@ yy445: } re2c: warning: line 253: rule matches empty string [-Wmatch-empty-string] re2c: warning: line 288: empty character class [-Wempty-character-class] -re2c: warning: line 289: unreachable rule [-Wunreachable-rules] re2c: warning: line 290: control flow is undefined for strings that match '[\x0-\x8\xA-\xC\xE-\x1F\x21-\x2E\x30-\xFF]' '\x2F [\x0-\x29\x2B-\xFF]' , use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 289: unreachable rule [-Wunreachable-rules]