Re: [Flex-help] declaration error after code generation
flex is a tool for generating scanners
Brought to you by:
wlestes
From: George N. <gn...@gm...> - 2009-03-30 03:52:13
|
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 > |