|
From: Sergey P. <si...@si...> - 2015-12-02 07:46:04
|
I've been upgrading version of linux-gpib we use in-house and I had
problem compiling 3.2.21 on both Fedora22 and CentOS7 . The error was
====================================8<------------------------------
In file included from ibConfLex.l:11:0:
ib_internal.h:132:53: error: unknown type name 'YYLTYPE'
#define YY_DECL int gpib_yylex(YYSTYPE *gpib_lvalp, YYLTYPE *gpib_llocp, yyscan_t yyscanner)
^
ibConfLex.c:846:1: note: in expansion of macro 'YY_DECL'
YY_DECL
====================================8<------------------------------
It does not always shows up (you definitely want to remove both
ibConfYacc.c and ibConfYacc.h before trying to hit the issue). The root
cause is that YYLTYPE is not defined in those two generated files.
I think the cause is the redefinition of yyerror() a few commits
back.
Here is a change that fixes the problem (definition of yyerror() is
moved into a second "prologue" section placed after %union {...} )
====================================8<------------------------------
Index: lib/ibConfYacc.y
===================================================================
--- lib/ibConfYacc.y (revision 283)
+++ lib/ibConfYacc.y (revision 284)
@@ -9,10 +9,6 @@
#include "ibConfLex.h"
#define YYERROR_VERBOSE
-static void yyerror(struct YYLTYPE *a, void *b, void *c, const char *s)
-{
- fprintf(stderr, "%s\n", s);
-}
YY_DECL;
@@ -125,6 +121,13 @@
char cval;
}
+%{
+static void yyerror(YYLTYPE *a, void *b, void *c, const char *s)
+{
+ fprintf(stderr, "%s\n", s);
+}
+%}
+
%token T_INTERFACE T_DEVICE T_NAME T_MINOR T_BASE T_IRQ T_DMA
%token T_PAD T_SAD T_TIMO T_EOSBYTE T_BOARD_TYPE T_PCI_BUS T_PCI_SLOT
%token T_REOS T_BIN T_INIT_S T_DCL T_XEOS T_EOT
====================================8<------------------------------
- Sergey Panov
|