Subject: bin/11845: flex's yy_flex_realloc() missing when stack option and [*+] are used after '/' operator
To: None <gnats-bugs@gnats.netbsd.org>
From: None <heas@shrubbery.net>
List: netbsd-bugs
Date: 12/29/2000 21:35:17
>Number:         11845
>Category:       bin
>Synopsis:       flex's yy_flex_realloc() missing when stack option and [*+] are used after '/' operator
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 29 21:35:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     heasley
>Release:        1.5 release sparc - built ~11/20
>Organization:
>Environment:
NetBSD guelah 1.5 NetBSD 1.5 (maple) #1: Sun Nov 26 19:40:16 GMT 2000     heas@maple:/usr/src/sys/arch/sparc/compile/maple sparc

>Description:
yy_flex_realloc is missing when rules use [*+] (possibly others) after
the '/' operator.

% gcc -o foo lex.yy.c -lfl
/tmp/cc4Oyv94.o: In function `yy_push_state':
/tmp/cc4Oyv94.o(.text+0x1a04): undefined reference to `yy_flex_realloc'
collect2: ld returned 1 exit status

>How-To-Repeat:
%option stack
WS      [ \t]
%s foo
%%
<foo>{WS}+x/y+  { BEGIN(0); return(yytext[0]);}
.               { return(yytext[0]);}
%%
yyerror (char *s)
{
    if (s != NULL)
       fprintf(stderr, "%s\n", s);
}

flex FILENAME
gcc -o foo lex.yy.c -lfl
>Fix:
not sure.  probably loosely related to
----------------------------
revision 1.10
date: 1999/01/14 06:58:40;  author: lukem;  state: Exp;  lines: +8 -5
remove "unused function yy_flex_realloc()" warning if using %options yylineno
----------------------------

it compiles if the '#ifndef YY_USES_REJECT's are removed from around the
yy_flex_realloc definitions, but the above cvs entry seems to indicate
that this produces other problems.  i have not used yylineno.
>Release-Note:
>Audit-Trail:
>Unformatted: