FLEX, was Re: Return value of malloc(0)





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

_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: contiguous memory allocation problem
    ... typedef int YYSTYPE; ... GCC error, not a FLEX error. ... *same exact* source code compiles just fine under Linux with GCC, ...
    (freebsd-hackers)
  • Re: running a c++ program using unix command
    ... NB 'mexatexit.cpp' compiles and runs for me, but I need to use the STL classes. ... You are using gcc version "4.2.4". ... I am trying to run an executable from within matlab using either of unix, ... but running the same executable directly in the terminal in linux, ...
    (comp.soft-sys.matlab)
  • Re: [9fans] Fortran
    ... I think the thing that got gcc where it is is Linux, ... probably the only tool that compiles it! ...
    (comp.os.plan9)
  • Re: Compiling Java for Cross Platform Compatibility
    ... it should work because java compiles to the same bytecode. ... > Unfortunately I'm having difficulty accessing the linux machines as I ... installation is becoming more and more of a doddle nowadays. ...
    (comp.lang.java.help)
  • Re: To the Brotherhood of the Consoles (Warning contains Wibble)
    ... >Linux challenges you. ... >documentation, waiting for compiles, sifting through newsgroups & ... Instead of reading documentation ...
    (comp.sys.sinclair)