(f)lex & poisoned malloc / free in system.h
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Thu May 3 19:14:00 GMT 2001
> Since (f)lex generates malloc / free in its autogenerated
> code, and since mostly generated lexers include the parser's generated
> header, which in turn includes the YYSTYPE union, which in turn will
> inevitably require headers that require system.h - how can one use
> (f)lex to generate a lexer for a gcc language frontend in gcc 3 ?
>
> Of course, I'm lead to believe that only the slow of thinking
> like to use generated lexers - and this seems to be born out by a lack
> of .l's lying in the gcc source tree.
>
> Naturaly I'm almost certainly missing a trivial, portable way
> to override the autogenerated malloc / free, but I can't find one
> lurking in the man pages.
>
> Any thoughts ?
> Michael Meeks.
I don't know how to override the use of malloc in (f)lex, so if you
find one let me know. Barring that if flex defines some magic macro
(FLEX_SCANNER?) then we could bypass the poison in system.h when it
sees that defined.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc
mailing list