From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Dec 19 16:55:06 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 868561DB for ; Fri, 19 Dec 2014 16:55:06 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CAB61BA4 for ; Fri, 19 Dec 2014 16:55:06 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sBJGt6A0040615 for ; Fri, 19 Dec 2014 16:55:06 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 196135] New: Fix graphics/ImageMagick installed headers, and some other clang 3.5.0 warnings Date: Fri, 19 Dec 2014 16:55:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kwm@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2014 16:55:06 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196135 Bug ID: 196135 Summary: Fix graphics/ImageMagick installed headers, and some other clang 3.5.0 warnings Product: Ports Tree Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: kwm@FreeBSD.org Reporter: dim@FreeBSD.org Assignee: kwm@FreeBSD.org Flags: maintainer-feedback?(kwm@FreeBSD.org) Created attachment 150782 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150782&action=edit Fix several clang 3.5.0 warnings in graphics/ImageMagick In bug 195480, which is about fixing as many ports as possible for the clang 3.5.0 import, there are some newly reported port failures, which are caused by ImageMagick headers [1]. In case of graphics/dcraw-m, this results in -Werror warnings: In file included from dcraw-m.c:53: In file included from /usr/local/include/ImageMagick-6/wand/MagickWand.h:72: In file included from /usr/local/include/ImageMagick-6/magick/MagickCore.h:120: /usr/local/include/ImageMagick-6/magick/memory_.h:29:36: error: unknown attribute '__alloc_size__' ignored [-Werror,-Wunknown-attributes] *(*AcquireMemoryHandler)(size_t) magick_alloc_size(1), ^ /usr/local/include/ImageMagick-6/magick/method-attribute.h:127:48: note: expanded from macro 'magick_alloc_size' # define magick_alloc_size(x) __attribute__((__alloc_size__(x))) ^ This is because the ImageMagick headers erroneously assume that clang supports the __alloc_size__ attribute. See also the upstream commit [2] which introduced this error. The fix for this is to define the magic_alloc_size, magic_alloc_sizes, wand_alloc_size and wand_alloc_sizes macros as empty, when clang is used. Additionally, since clang does support the __hot__ and __cold__ attributes, these can be split off to a separate #ifdef block. Another cause of many warnings is the sloppy usage of fabs(), even for float or long double type, resulting in hundreds of warnings like: In file included from coders/tga.c:47: ./magick/color-private.h:44:8: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if ((fabs(red-q->red) < MagickEpsilon) && ^ ./magick/color-private.h:44:8: note: use function 'fabsl' instead if ((fabs(red-q->red) < MagickEpsilon) && ^~~~ fabsl ImageMagick should really define a magick_fabs() macro for this, and do a global search and replace, but for our port that results in a diff that is very big, and fragile to apply. Therefore, fix this by #define'ing fabs as the correct function to call for each particular MagickRealType (e.g. float, double or long double). It would be nice if these changes go upstream. [1] http://pb2.nyi.freebsd.org/data/head-amd64-PR195480-default/2014-12-12_23h17m02s/logs/errors/dcraw-m-9.22.log [2] http://trac.imagemagick.org/changeset/14360 --- Comment #1 from Bugzilla Automation --- Auto-assigned to maintainer kwm@FreeBSD.org -- You are receiving this mail because: You are the assignee for the bug.