GNOME Bugzilla – Bug 773272
Support flex 2.6.1 and higher
Last modified: 2017-09-10 08:20:01 UTC
Created attachment 338098 [details] [review] Support changed EOF with flex 2.6.1 When compiling cinnamon, g-ir-scanner goes into an infinite loop when gobject-introspection is built from git with flex 2.6.1. This has been debugged and fixed in https://bugs.archlinux.org/task/51396
Review of attachment 338098 [details] [review]: Wait, what? And absolutely no rationale in the commit message. Why didn't he change it to 42 just for fun? Is there an upstream issue for this yet? Anyways, *this* patch looks like an OK workaround, thanks.
This patch has been sitting in commit_now status for quite a while...
(In reply to Colin Walters from comment #1) To be fair, it seems this changes the behavior (back?) to match the documentation, which has been stating, for at least 16 years: > If it [yywrap] returns true (non-zero), then > the scanner terminates, returning 0 to its caller. > If input() encounters an end-of-file the normal yywrap() processing is > done. A "real" end-of-file is returned by input() as EOF. https://github.com/westes/flex/blob/609af5775f7277679dc3bd966b36f04cf7ccf2a8/doc/flex.texi#L1572 https://github.com/westes/flex/blob/609af5775f7277679dc3bd966b36f04cf7ccf2a8/doc/flex.texi#L4550
commit cf04292691625e8abcd8cc8af9436809f273e5a0 Author: Jan de Groot <jgc@archlinux.org> Date: Thu Oct 20 12:14:19 2016 +0000 giscanner: fix EOF check with flex >= 2.6.1 It looks like flex 2.6.1 changed [1] the return code for EOF in yyinput. Therefore, use the right value depending on the version of flex which generates the lexer. [1] https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff