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

fix compile warning originating in cpp skeleton #495

Merged
merged 1 commit into from
Jul 7, 2021

Conversation

GitMensch
Copy link
Contributor

@GitMensch GitMensch commented Jun 22, 2021

gcount() is of type streamsize which has a system-dependent size with at least int. Because of the int max_size limit no bigger value will be returned, the explicit cast fixes warnings from compilers/static analyzers.

As an alternative LexerInput may be changed to have a return and parameter of type streamsize, but this would need more changes and likely create more warnings in other places.

This issue originates from lexxmark/winflexbison#73 where more details can be found (this is not a MSVC only issue).

`gcount()` is of type `streamsize` which has a system-dependent size with at least `int`. Because of the `int max_size` limit no bigger value will be returned, the explicit cast fixes warnings from compilers/static analyzers.
Copy link
Contributor

@Mightyjo Mightyjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Your reasoning makes sense. I double-check that streamsize is defined as a "signed, integral type", so with our limit to int max_size this seems right.

'git clean -xf' ... 'make distcheck' from a clean maintainer tree build cleanly.

@GitMensch
Copy link
Contributor Author

@Mightyjo Thanks for the review, so it is up to @westes to merge.

Side question @westes: maybe there's someone that could be added as a developer to this repo and could work on handling the PRs (currently 39 open) / issues (>100)?

@westes westes merged commit b198864 into westes:master Jul 7, 2021
@GitMensch GitMensch deleted the patch-2 branch July 7, 2021 21:28
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

Successfully merging this pull request may close these issues.

3 participants