[PATCH 1/5] dmx: Silence lex/yacc-related config parser warnings

Adam Jackson ajax at redhat.com
Tue Dec 8 13:05:51 PST 2015


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/dmx/config/dmxconfig.c  | 2 +-
 hw/dmx/config/dmxparse.h   | 2 --
 hw/dmx/config/dmxtodmx.c   | 1 +
 hw/dmx/config/parser.y     | 1 +
 hw/dmx/config/scanner.l    | 6 ++++--
 hw/dmx/config/xdmxconfig.c | 1 +
 6 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c
index 1d10ec0..c1a9e1c 100644
--- a/hw/dmx/config/dmxconfig.c
+++ b/hw/dmx/config/dmxconfig.c
@@ -48,7 +48,7 @@
 #include "dmxstat.h"
 #include "parser.h"
 
-extern int yyparse(void);
+extern int yydebug;
 extern FILE *yyin;
 
 static char *dmxXkbRules;
diff --git a/hw/dmx/config/dmxparse.h b/hw/dmx/config/dmxparse.h
index cc2f0eb..a64b36f 100644
--- a/hw/dmx/config/dmxparse.h
+++ b/hw/dmx/config/dmxparse.h
@@ -200,8 +200,6 @@ typedef struct _DMXConfigEntry {
 
 extern DMXConfigEntryPtr dmxConfigEntry;
 
-extern int yylex(void);
-extern int yydebug;
 extern void yyerror(const char *message);
 
 extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0);
diff --git a/hw/dmx/config/dmxtodmx.c b/hw/dmx/config/dmxtodmx.c
index 6634209..5a1a0b4 100644
--- a/hw/dmx/config/dmxtodmx.c
+++ b/hw/dmx/config/dmxtodmx.c
@@ -38,6 +38,7 @@
 #include "dmxcompat.h"
 
 extern int yyparse(void);
+extern int yydebug;
 extern FILE *yyin;
 
 int
diff --git a/hw/dmx/config/parser.y b/hw/dmx/config/parser.y
index ac24410..fa041a1 100644
--- a/hw/dmx/config/parser.y
+++ b/hw/dmx/config/parser.y
@@ -44,6 +44,7 @@
 #define YYERROR_VERBOSE
 #define YY_USE_PROTOS
 
+extern int yylex(void);
 DMXConfigEntryPtr dmxConfigEntry = NULL;
 #define APPEND(type, h, t)                 \
 {                                          \
diff --git a/hw/dmx/config/scanner.l b/hw/dmx/config/scanner.l
index e527d6d..3688fd7 100644
--- a/hw/dmx/config/scanner.l
+++ b/hw/dmx/config/scanner.l
@@ -84,10 +84,12 @@ param           return gettoken(T_PARAM, yytext, yyleng);
 %%
 int yywrap(void)
 {
+    (void) &yyunput;
+    (void) &input;
     return 1;
 }
 
-void yyerror(const char *message)
+_X_NORETURN void yyerror(const char *message)
 {
     const char *pt, *end;
     struct _entry {
@@ -109,7 +111,7 @@ void yyerror(const char *message)
     };
     
     fprintf(stderr, "parse error on line %d at token \"%*.*s\"\n",
-            lineno, yyleng, yyleng, yytext);
+            lineno, (int)yyleng, (int)yyleng, yytext);
     end = message + strlen(message);
     for (pt = message; *pt; pt++) {
         if (pt[0] == 'T' && pt[1] == '_') {
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 0540d01..49e4b54 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -53,6 +53,7 @@
 #include "dmxlog.h"
 
 extern int yyparse(void);
+extern int yydebug;
 extern FILE *yyin;
 
 #define DMX_INFO "xdmxconfig v0.9\nCopyright 2002 Red Hat Inc.\n"
-- 
2.5.0



More information about the xorg-devel mailing list