asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Bison 3 no longer supports YYPARSE_PARAM and YYPARSE_PARAM_TYPE.

Open mkhon opened this issue 9 years ago • 4 comments
trafficstars

byacc also supports %param-type

mkhon avatar Feb 05 '16 12:02 mkhon

Is there a way to support both bison 2 and bison 3?

vlm avatar Mar 26 '17 13:03 vlm

Hi @vlm,

Is there a way to support both bison 2 and bison 3?

For me this fix works well with bison 2.5 and 3.0.2. Only one compiler warning needs to be fixed

  CC       asn1p_y.lo
asn1p_y.y: In function 'asn1p_error':
asn1p_y.y:2465:16: error: unused parameter 'param' [-Werror=unused-parameter]
 yyerror(void **param, const char *msg) {

I workaround it with assert in mouse07410#3 and mouse07410#5

--- a/libasn1parser/asn1p_y.y
+++ b/libasn1parser/asn1p_y.y
@@ -2463,6 +2463,7 @@ _fixup_anonymous_identifier(asn1p_expr_t *expr) {
 
 int
 yyerror(void **param, const char *msg) {
+       assert(param);
        extern char *asn1p_text;
        fprintf(stderr,
                "ASN.1 grammar parse error "

velichkov avatar Mar 27 '17 17:03 velichkov

Re workaround: such warnings are typically fixed by casting to void: (void)param; or by using __attribute__((unused)) or the app-specific macro wrapping it, such as GCC_UNUSED for asn1c.

vlm avatar Mar 27 '17 18:03 vlm

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 15 '20 10:05 CLAassistant