From owner-freebsd-current@freebsd.org Fri Jul 27 15:23:26 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4FD2104E4E6 for ; Fri, 27 Jul 2018 15:23:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D16379E49; Fri, 27 Jul 2018 15:23:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 6700710AFD2; Fri, 27 Jul 2018 11:23:24 -0400 (EDT) Subject: Re: head -r336568 and -r336570 appears to have made ci.freebsg.org's FreeBSD-head-amd64-gcc fail either than it had been (error: operand type 'struct *' is incompatible with argument 1 of '__atomic_fetch_add') To: Mark Millard References: <95fdbf29-6c11-77a6-27a3-2d0dc30f1668@FreeBSD.org> <788B1EE7-EFC9-4AD4-9FD1-9876D0121189@yahoo.com> <9D40F38E-F1DC-4A3F-8792-09AD30D8802B@yahoo.com> <1ea2a8d0-b27a-503a-0a8b-48d7fbcd8fcb@FreeBSD.org> <0103123A-2D77-4D64-8FF6-97CD521CA7A8@yahoo.com> <11b515f2-5777-f983-bec5-e60bceda06ab@FreeBSD.org> <6DB0B921-30C8-4BF5-B610-770C0CBF1174@yahoo.com> <462BE582-0C2E-4D40-92F3-A27155777E58@yahoo.com> <1E03ECE7-297C-4D40-BC58-FB1903538181@yahoo.com> Cc: Konstantin Belousov , FreeBSD Current From: John Baldwin Message-ID: Date: Fri, 27 Jul 2018 08:23:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1E03ECE7-297C-4D40-BC58-FB1903538181@yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 27 Jul 2018 11:23:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 15:23:26 -0000 On 7/27/18 12:12 AM, Mark Millard wrote: > I was looking too locally: the overall context has an outer #if > as well that skips the section: > > /* > * Keywords added in C11. > */ > > #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L > . . . > #if !defined(__cplusplus) && !__has_extension(c_atomic) && \ > !__has_extension(cxx_atomic) > /* > * No native support for _Atomic(). Place object in structure to prevent > * most forms of direct non-atomic access. > */ > #define _Atomic(T) struct { T volatile __val; } > #endif > . . . > #endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ Yes. It also means that if we didn't ship the compiler's stdatomic.h and tried to build with -std=gnu11 or -std=c11 the compile would break. Rather than requiring c11, another approach might be to fix sys/cdefs.h and sys/stdatomic.h to actually work with modern GCC by having them not use the struct for the _GCC_ATOMICS case, only for the _SYNC case. I think that would fix all of the cases. -- John Baldwin