From: Rupert Swarbrick Date: Fri, 22 May 2020 13:29:42 +0000 (+0100) Subject: Silence spurious warning in Verilog lexer when compiling with GCC X-Git-Tag: working-ls180~533^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6aa0f72ae9e47c81441a2cecef18b7f90671ec6d;p=yosys.git 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. --- diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l index f6a3ac4db..65a2e9a78 100644 --- a/frontends/verilog/verilog_lexer.l +++ b/frontends/verilog/verilog_lexer.l @@ -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; "`file_push "[^\n]* { fn_stack.push_back(current_filename);