Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bison 3 no longer supports YYPARSE_PARAM and YYPARSE_PARAM_TYPE. #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkhon
Copy link

@mkhon mkhon commented Feb 5, 2016

byacc also supports %param-type

@vlm
Copy link
Owner

vlm commented Mar 26, 2017

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

@velichkov
Copy link
Contributor

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 "

@vlm
Copy link
Owner

vlm commented Mar 27, 2017

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.

@CLAassistant
Copy link

CLAassistant commented May 15, 2020

CLA assistant check
All committers have signed the CLA.

@Beliriel Beliriel mentioned this pull request May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants