[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem compiling flex sources
From: |
Jun Inoue |
Subject: |
Problem compiling flex sources |
Date: |
Tue, 29 Mar 2005 01:35:51 -0800 |
Hello.
Built global from CVS source, but with a few twists and turns.
flex generates a function yyalloc (yysize_t), but since c.l has %option
prefix="c", this becomes calloc (yysize_t) and conflicts with the standard
function.
I changed it to prefix="c_" with an underscore, making changes to other parts
accordingly, but then I got undefined references to yyin and yyrestart for each
*.l source. That's because DEFAULT_BEGIN_OF_FILE_ACTION defined in lexcommon.h
specifies these two symbols directly. Defining LEXIN and LEXRESTART in each
*.l file and using them in the header solved the problem. The attachment
includes these changes.
I use Debian GNU/Linux sarge flex 2.5.13.
I issued the commands:
sh reconf.sh && ./configure && make
Did I miss something? If not, I've two suggestions regarding this.
a) Let's #define LEX(x) (<prefix> ## x) and use that like LEX(in) or
LEX(restart). That way we don't have to add new defines to every single flex
source each time we need a new symbol.
b) Let's make all lex prefixes end with an underscore, or make them uppercase.
This will save concerns of the same sort of problem arising in the future.
What do you think?
Changelog for the attachment:
March 29 2005, Jun Inoue
* htags/c.l,src2html: Change prefix to c_.
* htags/c.l,cpp.l,java.l,asm.l: New macros.
* htags/lexcommon.h: Use the new macros.
--
Jun Inoue
address@hidden
lex.patch
Description: Binary data
- Problem compiling flex sources,
Jun Inoue <=