summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz PluciƄski <mplucinski@mplucinski.com>2014-07-25 17:41:50 +0200
committerWill Estes <westes575@gmail.com>2014-11-25 08:29:52 -0500
commit17c292bf03bccf4e808835f96f1260e6dd611b43 (patch)
tree7bda69680f38c02386604e7199bdb493fcb1084f
parentfef17765ca418361dd1260ae012d8f4a15d7f93c (diff)
Fix `implicit function declaration` warnings in tests
-rw-r--r--tests/bison_nr_parser.y2
-rw-r--r--tests/bison_yylloc_parser.y9
-rw-r--r--tests/bison_yylval_parser.y5
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 <stdlib.h>
#include <string.h>
#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 <stdlib.h>
#include <string.h>
#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 <stdlib.h>
#include <string.h>
#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;