I converted one of my parsers to generate C++.  I'm seeing a warning
that makes me wonder if I should do something differently.  I am using:

    %define api.location.type {cbl_loc_t}
    %require "3.5.1"  //    3.8.2 also works, but not 3.8.0
    %language "c++"
    %define api.prefix {ydf}
    %define api.token.prefix{YDF_}
    %locations
    %define parse.error verbose

where cbl_loc_t looks just like the default YYLTYPE.

The warning is:

cdf.cc: In member function ?virtual int ydf::parser::parse()?:
cdf.cc:595:9: warning: variable ?yynerrs_? 
                set but not used [-Wunused-but-set-variable=]
  595 |     int yynerrs_ = 0;
      |         ^~~~~~~~

The compiler has two parsers.  I intend them both to use the same
error function: 

        void yyerror( const char gmsgid[], ... );

which increments my own error count, independent of the generated
parser.  So I don't think I *need* parser::parser::yynerrs_.  But I
also don't know how I could use it if I wanted to.  

$ bison --version
bison (GNU Bison) 3.8.2

Thank you.

--jkl

Reply via email to