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

Warning GCC and Clang : Empty lines : %option '-L' #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpasukhi
Copy link

Files generated by latest flex have some problems:

  • build with GCC(v. 6+) Clang(v. 10+, apple Xcode) : [-Wmisleading-indentation] warnings
    fixed : flex/src/skel.l
  • generate with '-L' options and use a %top directive leads to a lot of empty line ( sequence of '\n' ) and
    a directive '#line' always generated for %top
    fixed :
    • flex/src/buf.c : fix incorrect comparison (!)
    • flex/src/scan.c add a check for '-L'

@lexxmark
Copy link
Owner

Hello @dpasukhi,

Have you tried to pull request this change to the upstream Gnu flex project?
I try to have minimal changes from original project to easily adopt new versions.

Regards,
Alex

@dpasukhi
Copy link
Author

Dear @lexxmark ,
I researched a gnu flex project.

The fix with flex/src/scan.c is not correct ( need to fix scan,l ), but this fix not respons for empty line. The correction of this file is not needed in this patch ( I'll clean up this, if you interested in the integration of this bug )
Fix of gcc/clang warnings has been integrated in the last year within westes/flex@a631f5d
The fix resolved problems with '-L' options was been request in the last September in the westes/flex#468

Best regards,
Dmitry.

@lexxmark
Copy link
Owner

I'll clean up this, if you interested in the integration of this bug

Since flex releases happening very rarely let's cleanup this pull request and I will merge it.

- Fixed [-Wmisleading-indentation] waning of clang(v10+) and gcc(v6+)
- Fixed a problem with a sequence of empty lines ('\n' sequence)
- Fixed a bugs with '-L' options (%top print a '#line')
@dpasukhi dpasukhi force-pushed the warning-gcc_clang--option_top-pagma-line_newlines branch from 0c79ba4 to 7f11968 Compare January 25, 2021 08:53
@GitMensch GitMensch assigned lexxmark and unassigned dpasukhi Jan 25, 2021
@GitMensch GitMensch added Flex Issues related to Flex upstream things that apply/should be done upstream labels Jun 22, 2021
@GitMensch
Copy link
Collaborator

Flex sources changed a lot since this PR and the possibly very soon next Flex release seems to have those issues fixed.
If the next release here will be likely based on the updated flex version then the change now is possibly not the right thing.

@lexxmark
Copy link
Owner

Is there any definite date for the next flex release?

@GitMensch
Copy link
Collaborator

No, only guesswork based on westes/flex#480 and the referenced issue. "Looks like we are near".
If any change is incorporated now it should be the bunch of changes from flex upstream, not this one which will lead to more conflicts for the later merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Flex Issues related to Flex upstream things that apply/should be done upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants