From owner-svn-src-all@freebsd.org Fri Feb 28 11:06:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07A4226045C; Fri, 28 Feb 2020 11:06:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48TRYc2G8zz4dQJ; Fri, 28 Feb 2020 11:06:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 01SB6Isx085486 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 28 Feb 2020 13:06:21 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 01SB6Isx085486 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 01SB6ILA085485; Fri, 28 Feb 2020 13:06:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 28 Feb 2020 13:06:18 +0200 From: Konstantin Belousov To: Warner Losh Cc: John Baldwin , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r358392 - head/share/man/man9 Message-ID: <20200228110618.GO29554@kib.kiev.ua> References: <202002271530.01RFUDJA087174@repo.freebsd.org> <5a876bf9-56b5-9465-07f4-2c540313755d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48TRYc2G8zz4dQJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[6]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-3.14), ipnet: 2001:470::/32(-4.65), asn: 6939(-3.58), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 11:06:30 -0000 On Thu, Feb 27, 2020 at 10:54:21PM -0700, Warner Losh wrote: > On Thu, Feb 27, 2020, 9:55 AM John Baldwin wrote: > > > On 2/27/20 7:30 AM, Warner Losh wrote: > > > Author: imp > > > Date: Thu Feb 27 15:30:13 2020 > > > New Revision: 358392 > > > URL: https://svnweb.freebsd.org/changeset/base/358392 > > > > > > Log: > > > _Static_assert is to be preferred to CTASSERT. > > > > > > Document the existing prefernce that _Static_assert be used in > > preference to the > > > old CTASSERT we used to use for compile time assertions. > > > > Actually, I think what we want to use is static_assert(). The intention in > > userland C is that _Static_assert() is an internal keyword and > > adds static_assert() as an alias, similar to defining alignas, > > etc. I think what we should do for the kernel is have define > > map static_assert to _Static_assert and replace existing _Static_assert > > usage with the proper spelling. > > > > I originally did just that when people pointed out that there were hundreds > of instances in the tree of _Static_assert and less than 10 of > static_assert. > > We could do a sweep and change, but I wanted to document it. Even more so > because I was originally mistaken. It could be declared to be a fault of the C standard, but I believe that _Static_assert() use is actually better over static_assert(). The standard defines _Static_assert() as the language feature, while static_assert() comes from the assert.h header that is not required by a freestanding environment. Note that this situation is not similar to _Bool/bool, because stdbool.h is required for conforming freestanding env.