]> granicus.if.org Git - flex/commitdiff
Fix `implicit function declaration` warnings in tests
authorMariusz Pluciński <mplucinski@mplucinski.com>
Fri, 25 Jul 2014 15:41:50 +0000 (17:41 +0200)
committerWill Estes <westes575@gmail.com>
Tue, 25 Nov 2014 13:29:52 +0000 (08:29 -0500)
tests/bison_nr_parser.y
tests/bison_yylloc_parser.y
tests/bison_yylval_parser.y

index 01c5dfe71742ad37f69ed57bdaf0fa06b3e5a7b7..57e5c6c572d2569054a77d992ae7925db8d34de2 100644 (file)
@@ -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 */
index e807c4d036c9b2659e26ebca58b1fd744fc2b3b9..6cff42480483918c46ce6c249d33aed4fd70398d 100644 (file)
 #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;
index a6ebfd327fe4d97fe03692e3206a2f5c1b52e61e..ca8c8da74b82efa2c1b1086d37b79e0d5f3f93cb 100644 (file)
 #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;