octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ambiguous call to "pow(int, unsigned int&)" in __magick_read__.cc:76


From: Jordi Gutiérrez Hermoso
Subject: Re: ambiguous call to "pow(int, unsigned int&)" in __magick_read__.cc:763
Date: Sat, 27 Aug 2011 11:37:38 -0500

On 27 August 2011 04:38, Carlo de Falco <address@hidden> wrote:
> Building the current tip on OSX 10.6 fails in DLD-FUNCTIONS/__magick_read__.cc
> with the following error:
>
> DLD-FUNCTIONS/__magick_read__.cc: In function 'void 
> encode_uint_image(std::vector<Magick::Image, std::allocator<Magick::Image> 
> >&, const octave_value&, bool)':
> DLD-FUNCTIONS/__magick_read__.cc:763: error: call of overloaded 'pow(int, 
> unsigned int&)' is ambiguous
> /usr/include/architecture/i386/math.h:343: note: candidates are: double 
> pow(double, double)
> /usr/include/c++/4.2.1/cmath:373: note:                 long double 
> std::pow(long double, int)
> /usr/include/c++/4.2.1/cmath:369: note:                 float std::pow(float, 
> int)
> /usr/include/c++/4.2.1/cmath:365: note:                 double 
> std::pow(double, int)
> /usr/include/c++/4.2.1/cmath:361: note:                 long double 
> std::pow(long double, long double)
> /usr/include/c++/4.2.1/cmath:357: note:                 float std::pow(float, 
> float)
>
> I can fix the error by changing line 763 to
>
> im.quantizeColors (static_cast<int> (pow (2, static_cast<double> 
> (bitdepth))));
>
> but it doesn't look very clean to me, what is this the correct fix?

If that's the version of pow you intended to call, there is nothing
wrong in disambiguating the call with a cast, especially if it's not a
C-style cast. If that fixes your build, I suggest you push that patch.
I am not seeing this problem on a more recent g++.

- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]