From 17c292bf03bccf4e808835f96f1260e6dd611b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= Date: Fri, 25 Jul 2014 17:41:50 +0200 Subject: Fix `implicit function declaration` warnings in tests --- tests/bison_nr_parser.y | 2 ++ tests/bison_yylloc_parser.y | 9 +++++++-- tests/bison_yylval_parser.y | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/bison_nr_parser.y b/tests/bison_nr_parser.y index 01c5dfe..57e5c6c 100644 --- a/tests/bison_nr_parser.y +++ b/tests/bison_nr_parser.y @@ -30,6 +30,8 @@ #include #include #include "config.h" +#include "parser.h" +#include "scanner.h" #define YYERROR_VERBOSE 1 /* #define YYPARSE_PARAM scanner */ diff --git a/tests/bison_yylloc_parser.y b/tests/bison_yylloc_parser.y index e807c4d..6cff424 100644 --- a/tests/bison_yylloc_parser.y +++ b/tests/bison_yylloc_parser.y @@ -33,6 +33,10 @@ #include #include #include "config.h" +#include "parser.h" +#include "scanner.h" + +int yyerror(YYLTYPE *location, void* scanner, const char* msg); #define YYERROR_VERBOSE 1 @@ -78,7 +82,7 @@ line: /* Check lineno. */ if( $1 != @1.first_line || $1 != testget_lineno(scanner)) { - yyerror("Parse failed: Line numbers do not match."); + yyerror(0, 0, "Parse failed: Line numbers do not match."); YYABORT; } @@ -89,7 +93,8 @@ line: %% -int yyerror(void* scanner, char* msg) { +int yyerror(YYLTYPE *location, void* scanner, const char* msg) { + (void)location; (void)scanner; fprintf(stderr,"%s\n",msg); return 0; diff --git a/tests/bison_yylval_parser.y b/tests/bison_yylval_parser.y index a6ebfd3..ca8c8da 100644 --- a/tests/bison_yylval_parser.y +++ b/tests/bison_yylval_parser.y @@ -32,9 +32,12 @@ #include #include #include "config.h" +#include "parser.h" +#include "scanner.h" #define YYERROR_VERBOSE 1 +int yyerror(void* scanner, const char* msg); /* A dummy function. A check against seg-faults in yylval->str. */ int process_text(char* s) { @@ -74,7 +77,7 @@ starttag: LT TAGNAME GT { process_text($2); free($2);} ; endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ; %% -int yyerror(void* scanner, char* msg) { +int yyerror(void* scanner, const char* msg) { (void)scanner; fprintf(stderr,"%s\n",msg); return 0; -- cgit v1.2.3