Fixing gcc 3.3 compile failures -- fix for math/freefem

Simon Barner barner at in.tum.de
Mon Jul 21 04:45:42 PDT 2003


> Can't compile freefem-3.5.7 with gcc-2.95.4 under RELENG_4,
> any idea?
> 
> source='femParser.cpp' object='femParser.lo' libtool=yes  depfile='.deps/femParser.Plo' tmpdepfile='.deps/femParser.TPlo'  depmode=gcc /bin/sh ../../admin/depcomp  /bin/sh ../../libtool --mode=compile c++ -DHAVE_CONFIG_H  -I. -I. -I../..      -Wall  -O -pipe  -fforce-mem -fforce-addr -fomit-frame-pointer  -I/usr/X11R6/include -c -o femParser.lo `test -f 'femParser.cpp' || echo './'`femParser.cpp
> rm -f .libs/femParser.lo
> c++ -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -O -pipe -fforce-mem -fforce-addr -fomit-frame-pointer -I/usr/X11R6/include -c femParser.cpp -Wp,-MD,.deps/femParser.TPlo  -fPIC -DPIC -o .libs/femParser.lo
> c++ -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -O -pipe -fforce-mem -fforce-addr -fomit-frame-pointer -I/usr/X11R6/include -c femParser.cpp -Wp,-MD,.deps/femParser.TPlo -o femParser.o >/dev/null 2>&1
> *** Error code 1
> Stop in /usr/home/osa/src/freefem/work/freefem-3.5.7/freefem/fem.
> *** Error code 1

Oh no, this port turns out to be a never ending story...

There was an internal compiler error in gcc-2.95.4 with femParser.cpp.
Since that version of gcc is no longer maintained, I think a workaround
for this problem is enough. Fortunately, I was able to fix the problem
by introducing a temporary variable (patch attached).

Cheers,
 Simon
 
P.S.: Also tested with gcc 3.3.1!
-------------- next part --------------
--- freefem/fem/femParser.cpp.orig	Thu Oct 25 00:49:36 2001
+++ freefem/fem/femParser.cpp	Mon Jul 21 13:32:54 2003
@@ -2913,7 +2913,10 @@
               for( k =0; k<3*__mesh.getNumberOfCells();k++)  (s->name)->table[k] = 0;
               }
             else
-              {  (s->name)->table = new creal[__mesh.getNumberOfPoints()];
+              { // This is in order to avoid an internal compiler error
+			    // with gcc 2.95.4 (FreeBSD) 
+			  	int n = __mesh.getNumberOfPoints();
+			  (s->name)->table = new creal[n];
               for( k =0; k<__mesh.getNumberOfPoints();k++)  (s->name)->table[k] = 0;
               }
             }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20030721/2c68796a/attachment.bin


More information about the freebsd-ports mailing list