hackt icon indicating copy to clipboard operation
hackt copied to clipboard

parser-generated *-parse.cc: yyssp declaration inconsistent with yystate

Open fangism opened this issue 12 years ago • 1 comments

parser/hackt-parse.cc:2860:12: error: implicit conversion loses integer precision: 'int' to 'yytype_int16' (aka 'short') [-Werror,-Wconversion] *yyssp = yystate; ~ ^~~~~~~ ./parser/hackt-prefix.h:12:18: note: expanded from macro 'yystate'

define yystate hackt_state

                    ^~~~~~~~~~~

parser/hackt-parse.cc:2865:25: warning: implicit conversion changes signedness: 'long' to 'unsigned long' [-Wsign-conversion] YYSIZE_T yysize = yyssp - yyss + 1; ~~~~~~ ^~~~~~~~~~~~~~~~ ./parser/hackt-prefix.h:55:16: note: expanded from macro 'yyssp'

define yyssp hackt_ssp

                    ^

This happens because yystate is declared an int by the parser skeleton (by bison), yet yyssp is declared as a short*. This triggers -Werror=conversion. Sloppy. Not sure if this can be fixed, responsibility belongs to bison, so should check with upstream.

fangism avatar Sep 07 '12 23:09 fangism

Workaround is to append -Wno-error=conversion to CXXFLAGS during configure.

fangism avatar Nov 14 '13 21:11 fangism