Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2006 22:40:45 -0700
From:      "Randall Hyde" <randyhyde@earthlink.net>
To:        <freebsd-hackers@freebsd.org>
Subject:   FLEX, was Re: Return value of malloc(0)
Message-ID:  <004201c69b3e$915bada0$6302a8c0@pentiv>
References:  <20060628181045.GA54915@curry.mchp.siemens.de> <44wtb12fu0.fsf@be-well.ilk.org> <004301c69b1d$164b5370$6302a8c0@pentiv> <20060629021028.GA31866@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
> >
>
> Without seeing the code or the actual error message, I'm
> guessing the answer is 42.  Perhaps, some detail might
> be appropriate.

I seriously doubt seeing the code  will do much good.
Here's the offending line:

  YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
   yy_n_chars, num_to_read );


This is from
static int yy_get_next_buffer()

Which is part of the canned code that comes with FLEX.
Compiles just fine under Linux. Linux has a slightly newer version of GCC,
but I've been compiling this code on Windows (Borland and VC++) as well as
Linux for years without a problem (i.e., older versions of GCC).

BTW, if anyone is intrested in the full FLEX source, it's part of the HLA
(High Level Assembler) source package found here:


http://webster.cs.ucr.edu/AsmTools/HLA/HLAv1.84/hlasrc.zip

I compiled the FLEX code with the command line:

flex -8 -i hla.flx

This works fine, then I compile the GCC output with

gcc -DfreeBSD -c -o lex.yy.o lex.yy.c

and it stops with "syntax error before numeric constant".

As this code is in part of the FLEX-supplied C code, I would think that this
problem would be independent of my particular flex code. BTW, I've tried
using both the FLEX I use on Linux under BSD as well as the BSD-supplied
version. I've even taken the FLEX output from freeBSD and compiled it under
Linux (it compiles successfully.

I'm using GCC 3.3.5 under Linux, 3.4.4 under BSD. Any known problems with
3.4.4 that would cause this?

cheers,
Randy Hyde




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004201c69b3e$915bada0$6302a8c0>