[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cast ambiguity compilation error
From: |
John W. Eaton |
Subject: |
Cast ambiguity compilation error |
Date: |
Mon, 19 Jan 2009 10:57:29 -0500 |
On 18-Jan-2009, Daniel J Sebald wrote:
| I've gotten Mercurial working on my FC3 machine (hoorah!). Python path
problem...
|
| Compiling the latest source on this older system has uncovered one small
syntax problem, I believe. Or I have some outdated compiler, std library
headers, or something.
|
| The issue is the abiguity of '!' operator overloaded in oct-inttypes.h. An
example string of errors is below. There are only a few spots where these
errors are occuring. (Note that the errors are happening when building
liboctave, not the src.) I fixed one instance with a kludge old-style case:
|
|
| diff -Pur octave/liboctave/intNDArray.cc octave-mod/liboctave/intNDArray.cc
| --- octave/liboctave/intNDArray.cc 2009-01-18 13:45:08.000000000 -0600
| +++ octave-mod/liboctave/intNDArray.cc 2009-01-18 13:53:19.000000000
-0600
| @@ -53,7 +53,7 @@
| {
| T val = this->elem (i);
|
| - if (((double)val) != 0.0 && ((double)val) != 1.0)
| + if (val != 0.0 && val != 1.0)
| return true;
| }
Your diff seems to be reversed.
Would it work to use
if (val != 0 && val != 1)
instead?
jwe