From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: Re: GNU Guile 2.1.6 released (beta) Date: Thu, 9 Mar 2017 18:52:21 -0800 Message-ID: References: <87tw8v7pjz.fsf@pobox.com> <87d1dquodn.fsf@pobox.com> <7770F510-0C7B-4A6C-96DD-37F1DE9565C6@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_7196F7E2-784B-416B-85BC-18C2C3622517" X-Trace: blaine.gmane.org 1489114365 18862 195.159.176.226 (10 Mar 2017 02:52:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Mar 2017 02:52:45 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 10 03:52:39 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmAfR-0003mD-GW for guile-devel@m.gmane.org; Fri, 10 Mar 2017 03:52:34 +0100 Original-Received: from localhost ([::1]:37110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmAfX-0005gF-Iw for guile-devel@m.gmane.org; Thu, 09 Mar 2017 21:52:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmAfO-0005g2-QN for guile-devel@gnu.org; Thu, 09 Mar 2017 21:52:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmAfK-00063O-SX for guile-devel@gnu.org; Thu, 09 Mar 2017 21:52:30 -0500 Original-Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]:35335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmAfK-00062s-IX for guile-devel@gnu.org; Thu, 09 Mar 2017 21:52:26 -0500 Original-Received: by mail-pg0-x234.google.com with SMTP id b129so33469253pgc.2 for ; Thu, 09 Mar 2017 18:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=OQbYWwTk35MGyzJRNQghfLwXpihvew+cdA5CDgJPXDA=; b=tcOjJ0bYJ6xTbr9lQb3cK7WTG1ke1brHL9jai9Yc7U4da2KU6vW+6QtelCKiQ8hAh4 HSxbDw6C20Ea6ivX9a3RhrCdGwvVWCM24bGC3OR3XHtXYJe42+jxOaaFuYiJE191nETP DraIDOi+K8It2ACqCNXIwO9YRZ5PccFeJGf+VAEd3RzIdiBWGfgwWy2YXvBfq3XmnXxQ EYvdSF5l5jsN7GNrZ/UOG/L/AvYAYHqfWzJQEoipru0xThCcPE+8BEHBw3th5mHCtiVg 3lzZd+kDASNVNVEC8Gqo7v7JD0mqJ+dEMAcUShdipk/mi35e2qkJZ19ZIoD3rVbs3Y+h pIrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=OQbYWwTk35MGyzJRNQghfLwXpihvew+cdA5CDgJPXDA=; b=AiXCQVDYp/hyAQdiKvD3Q04QfjdDuevjd16Hg0/rVODxeHTDrk4e9dcizxAhAudRJJ nkkBysRUGhlf/o86Z8hssjHoVxpfjfX0iQTTRyRHU1HdV7+SOnpHe31q2pl1WzzcuaQI VQHEtpTcMtFN17IhsqbNcn1iIXG/8vmxlQY9Yw1AnXwphYegMGkIZMbQaBiPVVA7hD7N z1GKcHeTi1lE1BY5ZJY8QTC+SwbSps3Dtij5mbDgveal+tW3BRL/9MO3Z5dxQ2f2GmX+ 8GfWqpJzg4Cn9TKjT0g6clVscqEA4n1ft0m21pdoRGC9hSEHvDmCl0kP7/H/yIf3vSYj W/dQ== X-Gm-Message-State: AMke39mYXrPMRc8ct9N0rV7/W8wYF3Kq9hb8zm/utT1i7Xn9S7AL1cOREAoYIHw0vGYzfA== X-Received: by 10.98.10.83 with SMTP id s80mr18002646pfi.27.1489114344098; Thu, 09 Mar 2017 18:52:24 -0800 (PST) Original-Received: from [192.168.2.114] (216-165-236-44.championbroadband.com. [216.165.236.44]) by smtp.gmail.com with ESMTPSA id g27sm14875490pfk.95.2017.03.09.18.52.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 18:52:22 -0800 (PST) In-Reply-To: <7770F510-0C7B-4A6C-96DD-37F1DE9565C6@gmail.com> X-Mailer: Apple Mail (2.3259) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::234 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19012 Archived-At: --Apple-Mail=_7196F7E2-784B-416B-85BC-18C2C3622517 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 9, 2017, at 6:01 PM, Matt Wette wrote: >=20 >=20 >> On Mar 9, 2017, at 1:33 PM, Andy Wingo > wrote: >> On Wed 25 Jan 2017 04:35, Matt Wette > writes: >>> So I am trying to compile using clang. This has detected issues with = atomics-internal.h. I can fix most issues with casts: >>> static inline uint32_t >>> scm_atomic_subtract_uint32 (uint32_t *loc, uint32_t arg) >>> { >>> - return atomic_fetch_sub (loc, arg); >>> + return atomic_fetch_sub ((_Atomic uint32_t *)loc, arg); >>> } >>>=20 >>> But problems remain with scm_atomic_set_pointer and = scm_atomic_ref_pointer which use void** and is apparently not defined = for use with atomics. >>>=20 >>> Apparently gcc does not have a problem with this use but I=E2=80=99m = guessing the C11 standard may have an issue with it. >>=20 >> WDYT about this? >>=20 >> Andy >=20 > Have not tried to chase this down but ... >=20 > In file included from async.c:27: > ../libguile/atomics-internal.h:75:20: error: address argument to = atomic operation must be a pointer to _Atomic type ('SCM *' (aka 'struct = scm_unused_struct **') invalid) > return SCM_PACK (atomic_exchange (loc, val)); > ^ ~~~ > = /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/include/stdatomic.h:137= :42: note: expanded from macro 'atomic_exchange' > #define atomic_exchange(object, desired) __c11_atomic_exchange(object, = desired, __ATOMIC_SEQ_CST) > ^ ~~~~~~ > ../libguile/tags.h:105:32: note: expanded from macro 'SCM_PACK' > # define SCM_PACK(x) ((SCM) (x)) > ^ > 1 error generated. >=20 With this change it compiles under clang-3.9, though generates warning, = and gets through make check (with required other unrelated patches) OK: static inline SCM scm_atomic_swap_scm (SCM *loc, SCM val) { volatile atomic_uintptr_t *a_loc =3D (volatile atomic_uintptr_t *)loc; return SCM_PACK (atomic_exchange (a_loc, val)); } --Apple-Mail=_7196F7E2-784B-416B-85BC-18C2C3622517 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Mar 9, 2017, at 6:01 PM, Matt Wette <matt.wette@gmail.com> wrote:


On Mar 9, 2017, at 1:33 PM, Andy Wingo <wingo@pobox.com> = wrote:
On Wed 25 Jan 2017 04:35, = Matt Wette <matt.wette@gmail.com> = writes:
So I am trying to compile = using clang. This has detected issues with atomics-internal.h. I can fix = most issues with casts:
static inline uint32_t
scm_atomic_subtract_uint32 (uint32_t *loc, uint32_t arg)
{
- return atomic_fetch_sub (loc, arg);
+ return atomic_fetch_sub ((_Atomic uint32_t *)loc, arg);
}

But problems remain with = scm_atomic_set_pointer and scm_atomic_ref_pointer which use void** and = is apparently not defined for use with atomics.

Apparently gcc does not have a problem with this use but = I=E2=80=99m guessing the C11 standard may have an issue with it.

WDYT about this?

Andy

Have = not tried to chase this down but ...

In file included from async.c:27:
../libguile/atomics-internal.h:75:20: error: address argument = to atomic operation must be a pointer to _Atomic type ('SCM *' (aka = 'struct scm_unused_struct **') invalid)
  = return SCM_PACK (atomic_exchange (loc, val));
                 =   ^                = ~~~
/opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/include/stda= tomic.h:137:42: note: expanded from macro = 'atomic_exchange'
#define atomic_exchange(object, desired) = __c11_atomic_exchange(object, desired, = __ATOMIC_SEQ_CST)
           =                     =           ^           =           ~~~~~~
../libguile/tags.h:105:32: note: expanded from macro = 'SCM_PACK'
#   define SCM_PACK(x) ((SCM) = (x))
           =                     = ^
1 error generated.


With this change it compiles under clang-3.9, = though generates warning, and gets through make check (with required = other unrelated patches) OK:

static inline = SCM
scm_atomic_swap_scm (SCM *loc, SCM = val)
{
  volatile atomic_uintptr_t *a_loc =3D = (volatile atomic_uintptr_t *)loc;
  return SCM_PACK = (atomic_exchange (a_loc, val));
}


= --Apple-Mail=_7196F7E2-784B-416B-85BC-18C2C3622517--