From help-request at octave dot org Fri Feb 18 16:24:55 2005 Subject: g++-4 vs. gperf (was: FYI: compiling octave with gcc4 (no go)) From: "John W. Eaton" To: "Dmitri A. Sergatskov" Cc: octave help mailing list Date: Fri, 18 Feb 2005 17:30:15 -0500 On 18-Feb-2005, Dmitri A. Sergatskov wrote: | I also got the following problem which I cannot solve: |=20 | g++4 -c -fPIC -I. -I.. -I../liboctave -I../src -I../libcruft/misc -= I../glob -I ../glob -DHAVE=5FCONFIG=5FH -mieee-fp -Wall -W -Wshadow -O2= -mcpu=3Dathlon-mp -mtune=3Da thlon-mp=20 | -pipe lex.cc -o pic/lex.o | octave.gperf: In function =91const octave=5Fkw* octave=5Fkw=5Flookup(= const char*, unsign ed int)=92: | octave.gperf:99: error: =91=92 is/uses anonymous type= | octave.gperf:99: error: trying to instantiate =91template = template octave=5Fint::octave=5Fint(U)=92 | ... | =09and later on | octave.gperf:103: error: =91=92 is/uses anonymous typ= e | octave.gperf:103: error: trying to instantiate =91template= template octave=5Fint::octave=5Fint(U)=92 | lex.l: In member function =91bool bracket=5Fbrace=5Fparen=5Fnesting=5F= level::is=5Fbracket()=92 : | lex.l:196: error: =91bracket=5Fbrace=5Fparen=5Fnesting=5Flevel::=92 is/uses anonymous type | lex.l:196: error: trying to instantiate =91template templa= te o ctave=5Fint::octave=5Fint(U)=92 | lex.l:196: error: =91bracket=5Fbrace=5Fparen=5Fnesting=5Flevel::=92 is/uses anonymous type |=20 | ... |=20 | This is not a crucial problem for me (I have a working octave, compil= ed with gcc3.4.3), | but perhaps of some interest to others... This code is generated by gperf. I think you can avoid the problem with the following patch. I see no reason to prefer enum values over defined constants here, so we might as well use this set of options for gperf. Thanks, jwe src/ChangeLog: 2005-02-18 John W. Eaton =09* Makefile.in (oct-gperf.h): Remove -E from list of gperf options. Index: src/Makefile.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/octave/src/Makefile.in,v retrieving revision 1.358 diff -u -r1.358 Makefile.in --- src/Makefile.in=0912 Feb 2005 02:29:34 -0000=091.358 +++ src/Makefile.in=0918 Feb 2005 22:21:55 -0000 at @ -531,7 +531,7 @@ =20 oct-gperf.h: octave.gperf =09 at echo "making $@ from $<" -=09 at $(GPERF) -t -C -D -E -G -L C++ -Z octave=5Fkw=5Fhash \ +=09 at $(GPERF) -t -C -D -G -L C++ -Z octave=5Fkw=5Fhash \ =09 $< | $(SED) 's,lookup\[,gperf=5Flookup[,' > $ at -t =09 at $(top=5Fsrcdir)/move-if-change $@-t $@ =20 ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------