[Pkgoctavedevel] Bug#532656: Bug#532656: octave3.2_3.2.01(mips/unstable): FTBFS on mips. Segfault in regression test.
John W. Eaton
jwe at jweaton.org
Mon Jun 15 13:31:18 UTC 2009
On 15Jun2009, Rafael Laboissiere wrote:
 Attached below is a patch for proutput.cc that makes Octave work as
 expected for 'complex(NaN,0)' on mips (and amd64 as well, FWIW). The
 package is being built right now on mips and on amd64 and, if everything
 goes well on both arches, I will upload to unstable a new version of the
 package, octave3.2_3.2.02, containing the patch.

 I am rushing with this because everything else is being held by this bug,
 like the upload of the new octaveforge packages.

 
 Rafael

 
  a/proutput.cc 20090615 08:48:48.000000000 +0200
 +++ b/proutput.cc 20090615 11:28:58.000000000 +0200
 @@ 852,10 +852,12 @@
 double i_abs = ip < 0.0 ? ip : ip;

 int r_x = r_abs == 0.0
  ? 0 : static_cast<int> (floor (log10 (r_abs) + 1.0));
 + ? 0 : ((xisinf (rp)  xisnan (rp))
 + ? INT_MIN : static_cast<int> (floor (log10 (r_abs) + 1.0)));

 int i_x = i_abs == 0.0
  ? 0 : static_cast<int> (floor (log10 (i_abs) + 1.0));
 + ? 0 : ((xisinf (ip)  xisnan (ip))
 + ? INT_MIN : static_cast<int> (floor (log10 (i_abs) + 1.0)));

 int x_max, x_min;
To be consistent with what is done int "set_format (double, ...)", I
think this should be
diff git a/src/proutput.cc b/src/proutput.cc
 a/src/proutput.cc
+++ b/src/proutput.cc
@@ 851,10 +851,10 @@
double r_abs = rp < 0.0 ? rp : rp;
double i_abs = ip < 0.0 ? ip : ip;
 int r_x = r_abs == 0.0
+ int r_x = (xisinf (rp)  xisnan (rp)  xr_abs == 0.0)
? 0 : static_cast<int> (floor (log10 (r_abs) + 1.0));
 int i_x = i_abs == 0.0
+ int i_x = (xisinf (ip)  xisnan (ip)  i_abs == 0.0)
? 0 : static_cast<int> (floor (log10 (i_abs) + 1.0));
int x_max, x_min;
Does that work for you? Similar changes may be needed in other
functions in case all the elements of a matrix are NaN, for example.
jwe
More information about the Pkgoctavedevel
mailing list