-
Notifications
You must be signed in to change notification settings - Fork 547
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
[RFC] POSIX-compliance of scan.l and bootstrapping #494
Comments
|
Re: POSIX compliance. Flex is not lex. Flex has a POSIX-compliant mode that we should make sure works as advertised but there's no reason flex should limit itself to using that mode. I was thinking about the bootstrap process. Like @Explorer09 said, flex used to emit A LOT of C that isn't in the skeleton. We had to bootstrap from one version to the next in order to replace all that emitted C code in scan.c, the compiled skeletons, etc. That's been dramatically reduced, but there's still some. |
My personal opinions about bootstrapping:
|
bootstrapping of (f)lex is not a posix feature of lex. |
@westes Here some thoughts and questions on the bootstrap feature:
scan.c
so that a bootstrap should not be necessary.flex
being able to compile itself, even when compiling from the git repo?scan.l
be compliant with a minimal standard, e.g. POSIX, such that any POSIX-compliant version oflex
should be able to compileflex
? (E.g. 4b5111d introduced the non-POSIX feature%top{...}
toscan.l
which would imply that some otherlex
version might not be able to digestscan.l
) Why would it be necessary to have a two-step approach (i.e. bootstrap) then at all?=> Preliminary conclusions:
flex
reproducesscan.c
(either shipped or generated using a(f)lex
version on the system) could be added as test to the test suite.scan.l
should be POSIX-compliant. (Otherwiseflex
would be insulated with otherflex
-compliantlex
versions (do they exist?) and independent from any otherlex
implementation.)config.h
generated using the host compiler works for the build compiler, too. For a proper approachconfigure && make
should be run twice, first for the build compiler to produce aflex
version executable on the system - if not yet available - , then for the host compiler ... something like so:=> Preliminary conclusions:
configure
run (build
) could be dropped and the secondconfigure
run (host
) only is needed, ifscan.l
was POSIX-compliant a POSIX-compliantlex
version was available on the system.All-in-all here my suggestions:
flex
scan.l
should be POSIX-compliant, otherwise it can be compiled byflex
and otherflex
-compliantlex
versions (not sure if there were any requests about this at all out there in the past).rpl_malloc
andrpl_realloc
which I believe currently is not correctly implemented (LIBOBJS
if non-void does not capture object files in the lib dir)).Thoughts? Any missing points? Any plans where
flex
is headed to?Thanks.
The text was updated successfully, but these errors were encountered: