# HG changeset patch # User David A. Holland # Date 1655093078 14400 # Node ID 1c9dac05d0401f06e50c526eb5a7d75e4a6c0223 # Parent bb115deb6fb262b42dd24687f13dd6c44cf3cbc0 Add lint-style FALLTHROUGH annotations to fallthrough cases. (in the parse engine and thus the output code) Document this, because the old output causes warnings with gcc10. diff -r bb115deb6fb2 -r 1c9dac05d040 anagram/agcore/engine.cgs --- a/anagram/agcore/engine.cgs Mon Jun 13 00:02:15 2022 -0400 +++ b/anagram/agcore/engine.cgs Mon Jun 13 00:04:38 2022 -0400 @@ -676,6 +676,7 @@ return; } } while (ag_look_ahead(PCBARG) == ag_ch); + /* FALLTHROUGH */ case ag_no_match_key: ag_fail: (PCB).rx = save_index; @@ -692,6 +693,7 @@ case ag_set_key: save_index = (PCB).rx; (PCB).token_number = (AG_TOKEN_TYPE) ag_key_parm[ag_k]; + /* FALLTHROUGH */ case ag_jmp_key: ag_k = ag_key_jmp[ag_k]; ag_ch = ag_look_ahead(PCBARG); @@ -884,6 +886,7 @@ } } while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch); } + /* FALLTHROUGH */ case ag_no_match_key: ag_fail: (PCB).la_ptr = (PCB).pointer + ag_save; @@ -900,6 +903,7 @@ case ag_set_key: ag_save = (int) ((PCB).la_ptr - (PCB).pointer); (PCB).token_number = (AG_TOKEN_TYPE) ag_key_parm[ag_k]; + /* FALLTHROUGH */ case ag_jmp_key: ag_k = ag_key_jmp[ag_k]; break; @@ -2507,6 +2511,7 @@ case ag_set_key: (PCB).save_index = (PCB).rx; (PCB).token_number = (AG_TOKEN_TYPE) ag_key_parm[(PCB).key_state]; + /* FALLTHROUGH */ case ag_jmp_key: (PCB).key_state = ag_key_jmp[(PCB).key_state]; continue; diff -r bb115deb6fb2 -r 1c9dac05d040 doc/misc/whatsnew.html --- a/doc/misc/whatsnew.html Mon Jun 13 00:02:15 2022 -0400 +++ b/doc/misc/whatsnew.html Mon Jun 13 00:04:38 2022 -0400 @@ -113,6 +113,13 @@

+Engine compiler warnings. The code generated by AnaGram +includes several switch cases that intentionally fall +through. These now include explicit FALLTHROUGH annotations +to satisfy current compilers. +

+ +

Multiple output header files. Including more than one AnaGram output header file at once used to cause some compilers to issue a warning, because an #ifndef directive was checking the wrong