Silence spurious warning in Verilog lexer when compiling with GCC

The chosen value shouldn't have any effect. I considered something
clearly wrong like -1, but there's no checking inside the generated
lexer, and I suspect this will cause even weirder bugs if triggered
than just setting it to INITIAL.
This commit is contained in:
Rupert Swarbrick 2020-05-22 14:29:42 +01:00
parent a7f2ef6d34
commit 6aa0f72ae9
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ static bool isUserType(std::string &s)
%x BASED_CONST
%%
int comment_caller;
// Initialise comment_caller to something to avoid a "maybe undefined"
// warning from GCC.
int comment_caller = INITIAL;
<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`file_push "[^\n]* {
fn_stack.push_back(current_filename);