Compile problem ov.cc of octave-3.1.51 on cygwin
Tatsuro MATSUOKA
tmacchant at yahoo.co.jp
Sat Jul 26 16:48:47 CDT 2008
Hello Jaroslav
Thank you for your reply.
--- Jaroslav Hajek <highegg at gmail.com> wrote:
> 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.
Tatsu at Inspiron6000 ~/octaves/octave-3.1.51/liboctave
$ g++ -DHAVE_CONFIG_H -I. -I../ -I ../libcruft/misc/ -c test.cc
test.cc: In function `int main()':
test.cc:7: error: conversion from `octave_int32' to `int' is ambiguous
oct-inttypes.h:324: note: candidates are: octave_int<T>::operator T() const [with T = int32_t]
oct-inttypes.h:328: note: octave_int<T>::operator double() const [with T = int32_t]
oct-inttypes.h:330: note: octave_int<T>::operator float() const [with T = int32_t]
test.cc:8:2: warning: no newline at end of file
Perhaps your idea is right. If you will make a patch for gcc-3.4.4 on cygwin, it will be helpful
for cygwin people.
Regards
Tatsuro
--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
More information about the Bug-octave
mailing list