Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yylex error when rebuilding lexer.c #1386

Closed
ghost opened this issue Apr 8, 2017 · 6 comments
Closed

yylex error when rebuilding lexer.c #1386

ghost opened this issue Apr 8, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 8, 2017

When my system builds "src/lexer.c" and "src/lexer.h", it adds this line among
others:

#define yylex jq_yylex

This causes a big problem:

In file included from src/parser.y:124:0:
src/lexer.h:44:19: error: conflicting types for ‘jq_yylex’
src/parser.y:149:5: note: in expansion of macro ‘yylex’
 int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,
     ^
In file included from src/parser.y:124:0:
src/lexer.h:405:12: note: previous declaration of ‘jq_yylex’ was here
src/parser.y: In function ‘jq_yylex’:
src/parser.y:152:13: error: too few arguments to function ‘jq_yylex’
   int tok = jq_yylex(yylval, yylloc, lexer);
             ^
In file included from src/parser.y:124:0:
src/lexer.h:44:19: note: declared here
src/parser.y:149:5: note: in expansion of macro ‘yylex’
 int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,
     ^

As a workaround, I can:

touch src/lexer.c

Or:

./configure --disable-maintainer-mode

but all these do is prevent "src/lexer.c" and "src/lexer.h" from being remade.

@wtlangford
Copy link
Contributor

What are your system's flex/bison versions? (Also, are they flex/bison or lex/yacc?)
Also, what's your system?

@ghost
Copy link
Author

ghost commented Apr 8, 2017

@wtlangford see below:

$ flex --version
flex 2.6.3

$ bison --version
bison (GNU Bison) 3.0.4

$ uname --all
CYGWIN_NT-6.1 Steven-PC 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64 Cygwin

@ghost
Copy link
Author

ghost commented Apr 8, 2017

@wtlangford it is the newer Flex that is causing the problem:

  • Cygwin 2.6.3 bad
  • Cygwin 2.6.1 good
  • Msys2 2.6.3 bad
  • Msys2 2.6.1 good

@wtlangford
Copy link
Contributor

wtlangford commented Apr 8, 2017 via email

@ghost
Copy link
Author

ghost commented Apr 9, 2017

@wtlangford see westes/flex#162 - issue has been fixed
on master and will be on 2.6.4 when it is released.

I think I will close this. It is a Flex issue not a JQ issue. Plus I dont really
have a good reason to rebuild lexer.c anyway. I have added
--disable-maintainer-mode to my build script:

http://github.com/svnpenn/glade/blob/1cb67d6/jq/install.sh#L6-L7

and removed Flex and Bison from my makefile:

http://github.com/svnpenn/glade/blob/1cb67d6/jq/makefile#L4

@ghost ghost closed this as completed Apr 9, 2017
@therealromster
Copy link

Just patch flex 2.6.3 or downgrade to 2.6.2 https://crux.nu/ports/crux-3.2/core/flex/flex-2.6.3-add_defines.patch

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants