winflexbison icon indicating copy to clipboard operation
winflexbison copied to clipboard

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

Open dpasukhi opened this issue 4 years ago • 6 comments

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'

dpasukhi avatar Jan 11 '21 10:01 dpasukhi

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

lexxmark avatar Jan 15 '21 04:01 lexxmark

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 https://github.com/westes/flex/commit/a631f5da8d4fd60fbde7b06bcf43bc9a155c27d5 The fix resolved problems with '-L' options was been request in the last September in the https://github.com/westes/flex/pull/468

Best regards, Dmitry.

dpasukhi avatar Jan 15 '21 08:01 dpasukhi

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.

lexxmark avatar Jan 25 '21 01:01 lexxmark

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.

GitMensch avatar Jun 22 '21 19:06 GitMensch

Is there any definite date for the next flex release?

lexxmark avatar Jun 24 '21 06:06 lexxmark

No, only guesswork based on https://github.com/westes/flex/pull/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.

GitMensch avatar Jun 29 '21 14:06 GitMensch