Incorrect C++ code in IM's header files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jpa

Incorrect C++ code in IM's header files

Post by jpa »

I'm trying to use ImageMagick++ with the new clang++ compiler.

On Fedora 13 this program:

Code: Select all

#include<iostream>
#include<Magick++.h>
using namespace Magick;

int main(int argc, char **argv) {
  std::cout << "It compiled." << std::endl;
  return 0;
}
Gives this error when compiled with clang++:

Code: Select all

In file included from imbug.cpp:2:
In file included from /usr/include/ImageMagick/Magick++.h:12:
/usr/include/ImageMagick/Magick++/STL.h:2220:18: error: no viable overloaded
'='
    quantizeInfo = dither_ ? MagickCore::MagickTrue : MagickCore::MagickFalse;
    ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from imbug.cpp:2:
In file included from /usr/include/ImageMagick/Magick++.h:9:
In file included from /usr/include/ImageMagick/Magick++/Include.h:47:
In file included from /usr/include/ImageMagick/magick/MagickCore.h:169:
In file included from /usr/include/ImageMagick/magick/deprecate.h:34:
/usr/include/ImageMagick/magick/quantize.h:35:16: note: candidate function (the
implicit copy assignment operator) not viable: no known conversion from
'MagickCore::MagickBooleanType' to 'MagickCore::_QuantizeInfo const' for 1st
argument
typedef struct _QuantizeInfo
I filed this as a bug in Clang's bug tracker but their response was that the definition of mapImages is invalid C++. See here for the actual discussion.

I used the latest clang from SVN. As far as I can remember, earlier versions of clang worked just fine.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Incorrect C++ code in IM's header files

Post by magick »

We can reproduce the problem and have a patch in ImageMagick 6.6.2-6 available by sometime tomorrow. Thanks.
Post Reply