-
Notifications
You must be signed in to change notification settings - Fork 537
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
"yywrap" macro redefined when %option noyywrap given #155
Comments
@DemiMarie do you have any thoughts on this? I assume this is the same issue as in #152 and #154. |
I think in the proposed case the macro #define yywrap yywrap // since flex 2.6.2 or 2.6.3, NB: to be guarded if yywrap defined below, i.e. %option noyywrap and further down #define yywrap() (/*CONSTCOND*/1) |
Why not simpy defining Separately, it appears that in flex.skl:58 (see snip below) m4's %not-for-header
%if-c-only
%if-not-reentrant
m4_ifelse(M4_YY_PREFIX,yy,,
#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]
[snip]
) |
A suggested patch to define --- main.c Thu Dec 29 21:03:14 2016
+++ main.c Fri Jan 13 13:28:59 2017
@@ -1586,9 +1588,9 @@
if (!do_yywrap) {
if (!C_plus_plus) {
if (reentrant)
- outn ("\n#define yywrap(yyscanner) (/*CONSTCOND*/1)");
+ outn ("\nint yywrap(yyscanner) { return /*CONSTCOND*/1; }");
else
- outn ("\n#define yywrap() (/*CONSTCOND*/1)");
+ outn ("\nint yywrap(void) { return /*CONSTCOND*/1; }");
}
outn ("#define YY_SKIP_YYWRAP");
} |
Looks like the same issue as #162; please confirm that you see this fixed for you on master now. |
Fixed on master. Thanks. |
…-generated code This is a bug in flex 2.6.3: westes/flex#155 lex.yy.c:397:0: error: "yywrap" redefined [-Werror] lex.yy.c:73:0: note: this is the location of the previous definition
…-generated code This is a bug in flex 2.6.3: westes/flex#155 lex.yy.c:397:0: error: "yywrap" redefined [-Werror] lex.yy.c:73:0: note: this is the location of the previous definition
…-generated code This is a bug in flex 2.6.3: westes/flex#155 lex.yy.c:397:0: error: "yywrap" redefined [-Werror] lex.yy.c:73:0: note: this is the location of the previous definition
…-generated code This is a bug in flex 2.6.3: westes/flex#155 lex.yy.c:397:0: error: "yywrap" redefined [-Werror] lex.yy.c:73:0: note: this is the location of the previous definition
Description:
This is based on the error seen with Gentoo bug #604732 (https://bugs.gentoo.org/show_bug.cgi?id=604732).
Specifying the noyywrap option causes GCC to emit a warning about yywrap being redefined. This does not happen if
%option noyywrap
is replaced with a correct yywrap() function definition.Steps to reproduce:
Create input file:
Run flex input.l
gcc -c input.c
observe warning
The expected result is for no warning to be emitted.
The text was updated successfully, but these errors were encountered: