Patch for Quad.cc compile error on Sun/GCC

Jaroslav Hajek highegg at gmail.com
Mon Apr 13 23:25:24 CDT 2009


On Tue, Apr 14, 2009 at 6:10 AM, Carsten Clark
<tantumquantum+gnuoctave at gmail.com> wrote:
> Hello all,
>
> There is a problem building the development sources on Solaris using
> GCC.  In liboctave/Quad.cc (float_user_function), the nonexistent
> utility functions access_float() and assign_float() are called.  This
> was done in changeset 7805 (62affb34e648), apparently imitating the
> use of the existing functions access_double() and assign_double().
>
> I'm attaching a patch that fixes this particular problem, removing the
> special handling of Sun/GCC which does not seem necessary.  The fix
> seems low-risk, but I have not gotten a build yet so I can't confirm
> that it will run.  I'd be happy to hang onto this patch until I can
> get a build and test it.
>
> I included a ChangeLog entry but I'm not used to ChangeLogs and won't
> mind if you don't use it.
>
> $ uname -a
> SunOS soon 5.11 snv_101b i86pc i386 i86pc
> $ g++ --version
> g++ (GCC) 3.4.3 (csl-sol210-3_4-20050802)
>
> Pre-patch, the build breaks thus:
>
> $ gmake
> gawk -f ./mk-ops.awk prefix=mx make_inclusive_header=mx-ops.h ./mx-ops
>> mx-ops.h-t
> if [ -s mx-ops.h-t ]; then ../move-if-change mx-ops.h-t mx-ops.h; else
> echo "mx-ops.h-t is empty!" 1>&2; rm -f mx-ops.h-t; exit 1; fi
> mx-ops.h is unchanged
> g++ -c -I/usr/include/pcre -I/usr/include/freetype2 -fPIC -I. -I..
> -I../liboctave -I../src -I../libcruft/misc  -DHAVE_CONFIG_H -mieee-fp
> -Wall -W -Wshadow -Wold-style-cast -Wformat -g -O2
> -I/usr/include/freetype2 Quad.cc -o pic/Quad.o
> In file included from Quad.cc:32:
> sun-utils.h: In function `double access_double(double*)':
> sun-utils.h:39: warning: use of old-style cast
> sun-utils.h: In function `void assign_double(double*, double)':
> sun-utils.h:54: warning: use of old-style cast
> sun-utils.h:55: warning: use of old-style cast
> Quad.cc: In function `octave_idx_type float_user_function(float*,
> int&, float*)':
> Quad.cc:110: error: `access_float' undeclared (first use this function)
> Quad.cc:110: error: (Each undeclared identifier is reported only once
> for each function it appears in.)
> Quad.cc:120: error: `assign_float' undeclared (first use this function)
> gmake: *** [pic/Quad.o] Error 1
>
>
> Post-patch, I have a seemingly unrelated error (let's see if you agree):
>

This is a bug in gcc (the old 3.x series) which is not able to resolve
such complicated template overloading (which is otherwise correct).
Upgrading gcc should help. So far nobody actually needed a work-around
patch for gcc 3, though I offered to make one.




-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Bug-octave mailing list