Compile problem ov.cc of octave-3.1.51 on cygwin

Jaroslav Hajek highegg at gmail.com
Sat Jul 26 04:43:24 CDT 2008


On Sat, Jul 26, 2008 at 9:58 AM, Tatsuro MATSUOKA <tmacchant at yahoo.co.jp> wrote:
> Hello
>
> This time is ov.cc
>
> I do not know that this is a bug or not.
> If the problem is suitable to help at octave.org, I will move it to there.
>
>
> /opt/octave/gcc-3.4.4dw2/bin/g++ -c -I/opt/octave/gcc-3.4.4dw2/include
> -I/opt/octave/octave-3.1.51/include -I/usr/X11R6/include  -I. -I.. -I../liboctave -I../src
> -I../libcruft/misc  -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wold-style-cast -g -O2 ov.cc -o ov.o
> ../liboctave/Array.h: In member function `T* Array<T>::coerce(const U*, int) [with U = octave_int32, T
> = octave_idx_type]':
> ../liboctave/Array.h:206:   instantiated from `Array<T>::Array(const Array<U>&)
> [with U = octave_int32, T = octave_idx_type]'
> ov.cc:1361:   instantiated from here
> ../liboctave/Array.h:179: error: conversion from `const octave_int<int32_t>' to
> `octave_idx_type' is ambiguous
> ../liboctave/oct-inttypes.h:324: note: candidates are: octave_int<T>::operator T() const [with T =
> int32_t]
> ../liboctave/oct-inttypes.h:328: note:  octave_int<T>::operator double() const [with T = int32_t]
> ../liboctave/oct-inttypes.h:330: note:  octave_int<T>::operator float() const [with T = int32_t]
> make[2]: *** [ov.o] Error 1
> make[2]: Leaving directory `/usr/tatsu/cygwin/octaves/octave-3.1.51/src'
> make[1]: *** [src] Error 2
>
> Any ideas ?
>

This  does not occur with g++ 4.2.1. Apparently the compiler is unable
to convert octave_int<int32_t> to default int. I'm not sure how
octave_idx_type comes into play because the offending line ov.cc:1361
requests a conversion from int32NDArray to Array<int>.
Can you try to compile the following simple test in the liboctave directory?
test.cc:
#include "config.h"
#include "oct-inttypes.h"
int main()
{
  int a;
  octave_int32 b = 0;
  a = b;
}

compile with `g++ -DHAVE_CONFIG_H -I. -I../ -I ../libcruft/misc/ -c test.cc'

In any case, I'm sure it's desirable for any octave_int32<T> instance
to be unambiguously convertible to default int and to octave_idx_type.
So if you confirm this, then unless anyone objects, I'll make a patch
to include the explicit conversions in octave_int32.

cheers

> Regards
>
> Tatsuro
>
>
> --------------------------------------
> Power up the Internet with Yahoo! Toolbar.
> http://pr.mail.yahoo.co.jp/toolbar/
>



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


More information about the Bug-octave mailing list