mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-07 00:01:49 -04:00
Avoid inclusion of unistd.h in generated lexers
Because the file is not available on all platforms the inclusion comes after the user options in order to disable including it. But that means the inclusion also follows after the defined scanner states, which are generated as simple #defines to numbers. If the included unistd.h e.g. uses variables in function definitions with the same names this could result in compilation errors. Interactive mode has to be disabled too as it relies on isatty() from unistd.h. Since we don't use the scanners interactively, this is not a problem and might even make the scanners a bit faster. Fixes #2806.
This commit is contained in:
parent
85431bf2e7
commit
97c4551ec8
@ -32,6 +32,11 @@ static void include_files(parser_helper_t *ctx);
|
||||
/* do not declare unneeded functions */
|
||||
%option noinput noyywrap
|
||||
|
||||
/* do not include unistd.h as it might conflict with our scanner states */
|
||||
%option nounistd
|
||||
/* due to that disable interactive mode, which requires isatty() */
|
||||
%option never-interactive
|
||||
|
||||
/* don't use global variables, and interact properly with bison */
|
||||
%option reentrant bison-bridge
|
||||
|
||||
|
@ -33,6 +33,11 @@ static void include_files(parser_helper_t *ctx);
|
||||
/* do not declare unneeded functions */
|
||||
%option noinput noyywrap
|
||||
|
||||
/* do not include unistd.h as it might conflict with our scanner states */
|
||||
%option nounistd
|
||||
/* due to that disable interactive mode, which requires isatty() */
|
||||
%option never-interactive
|
||||
|
||||
/* don't use global variables, and interact properly with bison */
|
||||
%option reentrant bison-bridge
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user