Re: [Flex-help] declaration error after code generation
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Aaron S. <aa...@se...> - 2009-03-30 19:34:33
|
It wouldn't be unreasonable for this to be the first time your code has been rebuilt with flex 2.5.3x, which were basically beta versions for a long time until a major bug in the uber-release flex 2.5.4 forced everyone to begin upgrading. What I'd like to do first is built the scanners with 2.5.4 and then compare the output to 2.5.3x latest, and see if the change in this line of generated code appears between those versions. Thank you very much for testing with all of the 2.5.3x's. Aaron On Mon, 30 Mar 2009 12:35:59 -0500, George Nychis <gn...@gm...> wrote: > OK, so I've tried to build with versions 2.5.35, 2.5.34, 2.5.33, and 2.5.31 > and none provide any success. > > The code was published in 2004, so it had to of used one of these versions, > which makes me suspect that it is a bug in the simulator code or something > I > don't understand. > > Any more thoughts? > > - George > > > On Sun, Mar 29, 2009 at 10:52 PM, George Nychis <gn...@gm...> wrote: > >> Hi Aaron, >> >> Thanks for the reply. I am using version 2.5.35, which I think is the >> most >> recent. I don't see anything on the flex website for developer code. >> >> - George >> >> >> On Sun, Mar 29, 2009 at 11:46 PM, Aaron Stone >> <aa...@se...>wrote: >> >>> Certainly looks like a bug. What version of flex are you using? >>> >>> On Sun, 29 Mar 2009 19:35:03 -0400, George Nychis <gn...@gm...> >>> wrote: >>> > Hi all, >>> > >>> > I am trying to build an architecture simulator ( >>> > http://cva.stanford.edu/books/ppin/#sim) that uses flex with bison to >>> > generate some code. I'm not extremely familiar with either tool. It >>> first >>> > uses flex to generate configlex.cpp from config.l: >>> > flex -Pconfig -oconfiglex.cpp config.l >>> > >>> > Here is config.l and configlex.cpp, respectively: >>> > http://pastebin.com/f746a6b77 >>> > http://pastebin.com/f598c894e >>> > >>> > Line 18 in config.l has: >>> > unsigned int configlineno = 1; >>> > >>> > After flex runs, configlex.cpp generates:extern int configlineno; // >>> line >>> > 361 >>> > int configlineno = 1; // line 363unsigned int configlineno = 1; // >>> > line >>> 493 >>> > >>> > This obviously creates a problem when it tries to build: >>> > config.l:18: error: conflicting declaration ‘unsigned int >>> configlineno’ >>> > configlex.cpp:363: error: ‘configlineno’ has a previous >>> > declaration >>> as >>> > ‘int >>> > configlineno’ >>> > >>> > Why does it generate both an int and an unsigned int? I would >>> appreciate >>> > any feedback. >>> > >>> > Thanks! >>> > George >>> > >>> >>> ------------------------------------------------------------------------------ >>> > _______________________________________________ >>> > Flex-help mailing list >>> > Fle...@li... >>> > https://lists.sourceforge.net/lists/listinfo/flex-help >>> >> >> |