From owner-svn-src-head@freebsd.org Mon Aug 28 09:02:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02DDCE09404 for ; Mon, 28 Aug 2017 09:02:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-57.reflexion.net [208.70.210.57]) (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 9D8796EFC8 for ; Mon, 28 Aug 2017 09:02:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1841 invoked from network); 28 Aug 2017 09:03:58 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 28 Aug 2017 09:03:58 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Mon, 28 Aug 2017 05:02:07 -0400 (EDT) Received: (qmail 3497 invoked from network); 28 Aug 2017 09:02:07 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 28 Aug 2017 09:02:07 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 54F3EEC8816; Mon, 28 Aug 2017 02:02:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322875 - head/sys/dev/nvme From: Mark Millard In-Reply-To: Date: Mon, 28 Aug 2017 02:02:05 -0700 Cc: David Chisnall , Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Transfer-Encoding: 7bit Message-Id: <0639EC0E-1F0F-4CB0-A3FE-4E8CD814B6D3@dsl-only.net> References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> To: Ed Schouten X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2017 09:02:15 -0000 On 2017-Aug-27, at 11:54 PM, Ed Schouten wrote: > 2017-08-25 14:53 GMT+02:00 Ed Schouten : >> 2017-08-25 9:46 GMT+02:00 Mark Millard : >>> It appears that at least 11.1-STABLE -r322807 does not handle >>> -std=c++98 styles of use of _Static_assert for g++7 in that >>> g++7 reports an error: >> >> Maybe we need to do something like this? >> >> Index: sys/sys/cdefs.h >> =================================================================== >> --- sys/sys/cdefs.h (revision 322887) >> +++ sys/sys/cdefs.h (working copy) >> @@ -294,7 +294,7 @@ >> #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ >> __has_extension(cxx_static_assert) >> #define _Static_assert(x, y) static_assert(x, y) >> -#elif __GNUC_PREREQ__(4,6) >> +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) >> /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ >> #elif defined(__COUNTER__) >> #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) > > Could you let me know whether this patch fixes the build for you? If > so, I'll commit it! As a variant of stable/11 -r322807 . . . buildworld and buildkernel seem to work fine. (I did not try any port [re-]builds.) Based on the same main.cc as before . . . g++7 -std=c++98 main.cc g++7 -Wpedantic -std=c++98 main.cc g++7 -std=c++03 main.cc g++7 -Wpedantic -std=c++03 main.cc no longer complain (so no error, no warning). clang++ -Wpedantic -std=c++11 main.cc clang++ -Wpedantic -std=c++98 main.cc clang++ -Wpedantic -std=c++03 main.cc each still give the warning but no error. g++7 -Wpedantic -std=c++11 main.cc g++7 -std=c++11 main.cc clang++ -std=c++11 main.cc clang++ -std=c++98 main.cc clang++ -std=c++03 main.cc are still silent, no errors, no warnings. Note that clang here is version 4 --the same as in my original report that had the g++7 rejection example. This is because of the stable/11 context that I used. (An intended MFC had been listed.) If needed I could probably try under some version of head (and so test clang version 5). === Mark Millard markmi at dsl-only.net