Hi,
I needed the attached patch to compile gpc with gcc 3.3 cvs. I am using flex 2.5.31 and I copied gcc-3.3.5.diff to gcc-3.3.6.diff. I don't know what happened to set_word_size and set_words_big_endian from gcc 3.3.5 to cvs. Having gpc-lex.c define malloc and realloc instead of yyalloc and yyrealloc allows gpc to link against libiberty which defines xmalloc and xrealloc.
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.
and I copied gcc-3.3.5.diff to gcc-3.3.6.diff. I don't know what happened to set_word_size and set_words_big_endian from gcc 3.3.5 to cvs.
They are defined in the code added by our patch. If you just copied it, there should be no difference.
Frank
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. I'm also fairly certain that defining malloc and realloc instead of yyalloc and yyrealloc is the right thing to do.
and I copied gcc-3.3.5.diff to gcc-3.3.6.diff. I don't know what happened to set_word_size and set_words_big_endian from gcc 3.3.5 to cvs.
They are defined in the code added by our patch. If you just copied it, there should be no difference.
Frank
Strange, I'll see if I can figured out what happened to my copied diffs.
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
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
On Tue, 29 Mar 2005 02:14:25 +0200, Frank Heckenbach ih8mj@fjf.gnu.de wrote:
: // 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
Thanks for explanation. I look forward to the next snapshot.