From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs,gmane.comp.programming.garbage-collection.boehmgc Subject: bug#18711: Numerous unknown attribute '__alloc_size__' warnings when using clang Date: Mon, 13 Oct 2014 23:53:57 -0400 Message-ID: <871tqbgvca.fsf@yeeloong.lan> References: <543C3C95.5050502@fultondesigns.co.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1413258926 19895 80.91.229.3 (14 Oct 2014 03:55:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2014 03:55:26 +0000 (UTC) Cc: bdwgc@lists.opendylan.org, 18711@debbugs.gnu.org To: William S Fulton Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Oct 14 05:55:18 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XdtCg-0006bO-L3 for guile-bugs@m.gmane.org; Tue, 14 Oct 2014 05:55:18 +0200 Original-Received: from localhost ([::1]:36257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdtCg-00066W-A4 for guile-bugs@m.gmane.org; Mon, 13 Oct 2014 23:55:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdtCX-00065j-LV for bug-guile@gnu.org; Mon, 13 Oct 2014 23:55:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XdtCS-0005t1-0y for bug-guile@gnu.org; Mon, 13 Oct 2014 23:55:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdtCR-0005sL-Tn for bug-guile@gnu.org; Mon, 13 Oct 2014 23:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XdtCQ-0000Nf-TN for bug-guile@gnu.org; Mon, 13 Oct 2014 23:55:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 14 Oct 2014 03:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18711 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 18711-submit@debbugs.gnu.org id=B18711.14132588801424 (code B ref 18711); Tue, 14 Oct 2014 03:55:02 +0000 Original-Received: (at 18711) by debbugs.gnu.org; 14 Oct 2014 03:54:40 +0000 Original-Received: from localhost ([127.0.0.1]:43075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XdtC3-0000Mt-Jk for submit@debbugs.gnu.org; Mon, 13 Oct 2014 23:54:40 -0400 Original-Received: from world.peace.net ([96.39.62.75]:38337) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XdtBz-0000Mi-Qt for 18711@debbugs.gnu.org; Mon, 13 Oct 2014 23:54:37 -0400 Original-Received: from c-24-62-95-23.hsd1.ma.comcast.net ([24.62.95.23] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XdtBs-00072E-03; Mon, 13 Oct 2014 23:54:28 -0400 In-Reply-To: <543C3C95.5050502@fultondesigns.co.uk> (William S. Fulton's message of "Mon, 13 Oct 2014 21:56:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7611 gmane.comp.programming.garbage-collection.boehmgc:6000 Archived-At: [Forwarding this bug report to bdwgc@lists.opendylan.org] William S Fulton writes: > A simple > > #include > > generates the numerous warnings given below: > > > In file included from example_wrap.c:702: > In file included from /usr/local/Cellar/guile/2.0.11_1/include/guile/2.0/libguile.h:37: > In file included from /usr/local/Cellar/guile/2.0.11_1/include/guile/2.0/libguile/async.h:28: > In file included from /usr/local/Cellar/guile/2.0.11_1/include/guile/2.0/libguile/threads.h:36: > In file included from /usr/local/Cellar/guile/2.0.11_1/include/guile/2.0/libguile/pthread-threads.h:33: > In file included from /usr/local/Cellar/guile/2.0.11_1/include/guile/2.0/libguile/bdw-gc.h:47: > /usr/local/Cellar/bdw-gc/7.4.2/include/gc/gc.h:411:23: warning: unknown attribute '__alloc_size__' ignored [-Wattributes] > GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL > ^ > /usr/local/Cellar/bdw-gc/7.4.2/include/gc/gc_config_macros.h:249:54: note: expanded from macro 'GC_ATTR_ALLOC_SIZE' > # define GC_ATTR_ALLOC_SIZE(argnum) __attribute__((__alloc_size__(argnum))) > ^ This is clearly an issue with bdwgc on clang, and possibly only on Apple's version of clang. Here's the relevant section of gc/gc_config_macros.h from bdwgc 7.4.2: --8<---------------cut here---------------start------------->8--- #ifndef GC_ATTR_ALLOC_SIZE /* 'alloc_size' attribute improves __builtin_object_size correctness. */ /* Only single-argument form of 'alloc_size' attribute is used. */ # if defined(__GNUC__) && (__GNUC__ > 4 \ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 && !defined(__ICC)) \ || __clang_major__ > 3 \ || (__clang_major__ == 3 && __clang_minor__ >= 2)) # define GC_ATTR_ALLOC_SIZE(argnum) __attribute__((__alloc_size__(argnum))) # else # define GC_ATTR_ALLOC_SIZE(argnum) # endif #endif --8<---------------cut here---------------end--------------->8--- You can see that the bdwgc developers have made an effort to check both GCC and clang version numbers before using the __alloc_size__ attribute. The code above seems to suggest that they believed clang 3.2 or later supported this attribute, whereas your version of clang seems to be based on upstream clang 3.5. Perhaps Apple removed support for this attribute from their clang? In any case, this needs to be taken up with the bdwgc developers. Regards, Mark > System information: > > $ guile --version | head -n 1 > guile (GNU Guile) 2.0.11 > > $ clang --version > Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) > Target: x86_64-apple-darwin13.4.0 > Thread model: posix > > $ xcodebuild -version -sdk | head -n 2 > MacOSX10.9.sdk - OS X 10.9 (macosx10.9) > SDKVersion: 10.9 > > $ sw_vers > ProductName: Mac OS X > ProductVersion: 10.9.5 > BuildVersion: 13F34 > > $ uname -a > Darwin itako16071.miso 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 > 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64