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

Fixing compile-time warnings #8

Closed
andan342 opened this issue Nov 6, 2017 · 7 comments
Closed

Fixing compile-time warnings #8

andan342 opened this issue Nov 6, 2017 · 7 comments

Comments

@andan342
Copy link

andan342 commented Nov 6, 2017

We have updated to the latest version of winflexbison after switching to C++17. Good news is that there are no more register variables in the generated code.

However, there are two new warnings in the generated code introduced by winflexbison version 2.6.3, which were not the case with version 2.5.37:

  1. (possible information loss) In yyuserAction() argument size_t yyrhslen is used to to compute an argument to yyfill(), which is int.

  2. (macro redefined) Macro yylex is defined in lexer and then re-defined in parser (yes, we use an intermediate layer, hence

#define yylex core_yylex

in the scanner (no such declaration here with v.2.5.37), and

#define yylex   base_yylex

in the parser.

The second problem might be related to westes/flex#162, which is fixed there.

@lexxmark
Copy link
Owner

lexxmark commented Nov 7, 2017

Thank you for reporting issues here.
As I see the 1st problem related with win_bison tool and the 2nd with win_flex.

I found yyuserAction name in \bison\data\glr.c file only. It's skeleton file to produce actual generator source code. I didn't modify it during migration to windows system. There is no newer version of GNU bison tool available. So if you want we can fix it by ourself, just give me a patch that fixes the code.

For the second warning I can upgrade win_flex from 2.6.3 to 2.6.4 and give you to test. If it fixes warnings I'll publish a new release.

Regards,
Alex

andan342 pushed a commit to andan342/winflexbison that referenced this issue Nov 7, 2017
andan342 pushed a commit to andan342/winflexbison that referenced this issue Nov 7, 2017
@andan342
Copy link
Author

andan342 commented Nov 7, 2017

PR #9 created, fixing the first warning.

lexxmark added a commit that referenced this issue Nov 8, 2017
Fixed 'possible data loss' warning inside Flex yyuserAction() - part of issue #8
lexxmark pushed a commit that referenced this issue Nov 8, 2017
@andan342
Copy link
Author

andan342 commented Nov 8, 2017

@lexxmark , thanks merging the fix!

The other problem appears to be already fixed in Flex 2.6.4:

*** We honor user defined yy_* macros again. We are also more careful to not leak macro definitions into header files.

Would be nice to update winflexbison to 2.6.4 soon. WDYT?

@lexxmark
Copy link
Owner

lexxmark commented Nov 8, 2017

I'm working on it.
Once it's done I'll issue an update.

Thank you

@lexxmark
Copy link
Owner

lexxmark commented Nov 9, 2017

Please try upgrated win_flex.exe executable:
win_flex.zip

@andan342
Copy link
Author

I just completed an extensive check. Works well now. Thanks a lot!

@lexxmark
Copy link
Owner

You are welcome!
I have upgraded download page on sourceforge web site.

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