The flex documentation says
If you do not supply your own version of 'yywrap()', then you must
either use '%option noyywrap' (in which case the scanner behaves as
though 'yywrap()' returned 1), or you must link with '-lfl' to obtain
the default version of the routine, which always returns 1.
Unfortunately, if noyywrap is given, gcc-5.4.0 complains with
config_file.c:417:0: warning: "yywrap" redefined
^
config_file.c:74:0: note: this is the location of the previous definition
Just provide our own yywrap() to silence the warning.
* Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html
*/
-%option noyywrap
%option stack
%option never-interactive
%option yylineno
static char **rargv;
static const char *subcommand;
+ static int yywrap(void) {return 1;}
static int expand_result(void)
{
int nargc = rargc + 1;
* Licensed under the GPL v3, see http://www.gnu.org/licenses/gpl-3.0.html
*/
-%option noyywrap
%option stack
%option never-interactive
%option yylineno
#define CUROPT (CURCMD.options[CURCMD.num_options - 1])
#define CURSECT (suite.sections[suite.num_sections - 1])
+ static int yywrap(void) {return 1;}
static void *xmalloc(size_t size)
{
void *p;