James A. Morrison wrote:
On Sun, 13 Mar 2005 10:51:10 +0100, Frank Heckenbach ih8mj@fjf.gnu.de wrote:
James A. Morrison wrote:
I needed the attached patch to compile gpc with gcc 3.3 cvs. I am using flex 2.5.31
Sorry, but flex-2.5.31 is not portable, so I can't use it in official distributions.
According to any Flex documention I have YY_CURRENT_BUFFER is available for use, not yy_current_buffer. It's probably just that newer versions of flex are stricter.
OK, applying this part.
I'm also fairly certain that defining malloc and realloc instead of yyalloc and yyrealloc is the right thing to do.
I don't think so. From the flex documentation:
: Flex calls the functions `yyalloc', `yyrealloc', and `yyfree' when : it needs to allocate or free memory. By default, these functions are : wrappers around the standard C functions, `malloc', `realloc', and : `free', respectively. You can override the default implementations by : telling flex that you will provide your own implementations. : : To override the default implementations, you must do two things: : : 1. Suppress the default implementations by specifying one or more of : the following options: : : * `%option noyyalloc' : : * `%option noyyrealloc' : : * `%option noyyfree'. : : 2. Provide your own implementation of the following functions: (1) : : : // For a non-reentrant scanner : void * yyalloc (size_t bytes); : void * yyrealloc (void * ptr, size_t bytes); : void yyfree (void * ptr);
Well, we didn't set these `%option's yet, instead `#define YY_NO_FLEX_ALLOC' etc., but I'm changing that now.
Frank