Error on Mac OS X 10.7: error: unknown attribute __hot__

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
DanKegel
Posts: 11
Joined: 2013-06-06T11:04:20-07:00
Authentication code: 6789

Error on Mac OS X 10.7: error: unknown attribute __hot__

Post by DanKegel »

Building apps that link to ImageMagick 6.8.8-4 on MacOS X 10.7 can fail with the error

In file included from /Users/buildbot/slave-state/osx107/g-speak-rbb-osx107-1/sandbox-osx107-master3_13/build/examples/radiology/radiology.C:26:
  • ...
    /opt/oblong/deps-64-9/include/ImageMagick/magick/pixel.h:179:42:
    error: unknown attribute '__hot__' ignored [-Werror,-Wattributes]
    DecodePixelGamma(const MagickRealType) magick_hot_spot,
    ^
    /opt/oblong/deps-64-9/include/ImageMagick/magick/method-attribute.h:132:43:
    note: expanded from macro 'magick_hot_spot'
    # define magick_hot_spot __attribute__((__hot__))
    ^
Evidently magick/method-attribute.h (and wand/method-attribute.h) have an incomplete compiler version check. Here's what I see there:
  • #if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) &&
    (__GNUC_MINOR__ >= 3)))
    # define magick_alloc_size(x) __attribute__((__alloc_size__(x)))
    # define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
    # define magick_cold_spot __attribute__((__cold__))
    # define magick_hot_spot __attribute__((__hot__))
    #else
    ...
    #endif
The clang I'm using is
  • $ clang++ --version
    Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin11.4.2
    Thread model: posix
Unfortunately,
  • #if defined(__has_attribute) && __has_attribute(__hot__)
is true on this compiler, and version number checking in clang is hard per http://sourceforge.net/p/predef/wiki/Compilers/
so a real fix might be hard.

If it's of interest, here's the commandline that failed:
  • clang++ -I /Users/buildbot/slave-state/osx107/g-speak-rbb-osx107-1/sandbox-osx107-master3_13/build/gtest/include
    -mmacosx-version-min=10.7 -isystem /include -Wempty-body
    -fdiagnostics-show-option -Wall -Wpointer-arith -Wshadow
    -Wwrite-strings -Wno-overloaded-virtual -Wno-strict-overflow
    -Wno-error=unused-variable -Werror -g -O3 -std=gnu++0x
    -Wno-parentheses -Wno-unused-command-line-argument -Wno-shadow
    -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -arch i386
    -arch x86_64 -isysroot
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
    -I/Users/buildbot/slave-state/osx107/g-speak-rbb-osx107-1/sandbox-osx107-master3_13/build
    -I/opt/oblong/g-speak3.13/include -I/opt/oblong/deps-64-9/include
    -I/opt/oblong/deps-64-9/include/ImageMagick -o
    CMakeFiles/hydra.dir/examples/hydra/hydra.C.o -c
    /Users/buildbot/slave-state/osx107/g-speak-rbb-osx107-1/sandbox-osx107-master3_13/build/examples/hydra/hydra.C
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Error on Mac OS X 10.7: error: unknown attribute __hot__

Post by magick »

We'll add a patch to ImageMagick 6.8.8-8 Beta to fix the problem you reported. Thanks.
DanKegel
Posts: 11
Joined: 2013-06-06T11:04:20-07:00
Authentication code: 6789

Re: Error on Mac OS X 10.7: error: unknown attribute __hot__

Post by DanKegel »

The patch helped, but a related problem remains. I will post on a new thread about the next problem.
Post Reply