From owner-svn-src-all@freebsd.org Sat Feb 22 19:24:57 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 F150B249FA0; Sat, 22 Feb 2020 19:24:57 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48PyvX2GQqz4Fjd; Sat, 22 Feb 2020 19:24:56 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:470:7a58::b8df:abc8:d12f:4fd2] (unknown [IPv6:2001:470:7a58:0:b8df:abc8:d12f:4fd2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 93B582C37A; Sat, 22 Feb 2020 20:24:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=andric.com; s=201904; t=1582399494; bh=iSO2mfLLzAE+3Wg7yQyFQ5ivymFVuVwq3e/6k2rN2yM=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=tHVsvLRmfxRujlcwYyOa2MCQfJb7n2JznnJ53vnzFgBDGUEXJdbq787F8o1uvXft2 lS7fBV1TUcvYtXAfTd5Eu1ESHZeXIu0sQVfO5sGxtWJOj40ksg4Uc3m4hL1U2HlxR3 qEas1aivppJFTVokhp6IiKrBfWoqjKtbCriIHuspnu6OK/N+tLH3StV+wVrp+yC5eS K+CHMLG2OoH1zKurYbJ/fOSWtcPsfuyiOLaWrOihy6LVuIOmrvccmyrOCK+SNmMq/b nBzCSASY/G/LOLLG9m1XhZSOLTlXd2pNp1msp/JhnLuc3QMPeEedijWGd+l9xXGthS 8wFHjeO2RerPg== From: Dimitry Andric Message-Id: <63F5EABB-78D3-4DA5-B306-CF12CC3A6FAF@andric.com> Content-Type: multipart/signed; boundary="Apple-Mail=_74EFF5FB-06C1-4E9E-B720-B20CA9152046"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r358248 - head/sys/vm Date: Sat, 22 Feb 2020 20:24:45 +0100 In-Reply-To: Cc: Mateusz Guzik , Kyle Evans , svn-src-head , svn-src-all , src-committers To: Ian Lepore References: <202002221620.01MGK46E072303@repo.freebsd.org> <6D39FAD8-E581-42A8-97B4-EE63800D78A4@andric.com> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 48PyvX2GQqz4Fjd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=andric.com header.s=201904 header.b=tHVsvLRm; dmarc=pass (policy=none) header.from=andric.com; spf=pass (mx1.freebsd.org: domain of dimitry@andric.com designates 87.251.56.140 as permitted sender) smtp.mailfrom=dimitry@andric.com X-Spamd-Result: default: False [-4.94 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[andric.com:s=201904]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:87.251.56.140]; MV_CASE(0.50)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[andric.com:+]; DMARC_POLICY_ALLOW(-0.50)[andric.com,none]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.34)[asn: 12859(-1.74), country: NL(0.03)]; ASN(0.00)[asn:12859, ipnet:87.251.32.0/19, country:NL]; FREEMAIL_CC(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sat, 22 Feb 2020 19:24:58 -0000 --Apple-Mail=_74EFF5FB-06C1-4E9E-B720-B20CA9152046 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 22 Feb 2020, at 20:13, Ian Lepore wrote: > > On Sat, 2020-02-22 at 20:01 +0100, Dimitry Andric wrote: ... >> E.g. this is *not* meant as a way to enforce the program to abort at >> runtime, if the supposedly unreachable part is actually reached. >> >> For this purpose, one should use an abort() or panic() function call, >> with such functions being annotated to never return. >> >> -Dimitry >> > > The problem is, people will see usages such as what Kyle did, where the > code truly is unreachable (due to -Werror=switch), and not realizing > that's why it's valid there, they'll assume it's a type of assert- > unreachable and copy it/use it in other places as if that's what it was > for. > > So, IMO, using it should be exceedingly rare and there should be a > comment nearby about why it's valid in that context, or our > __unreachable cover for it should panic on INVARIANTS, as Kyle proposed > in an earlier reply. It might be better to define our own UNREACHABLE macro, similar to what llvm itself does, roughly something like: __noreturn void internal_unreachable(const char *, const char *, int); #define UNREACHABLE(msg) internal_unreachable(msg, __FILE__, __LINE__) And have the implementation of internal_unreachable() log the file, line and message, then abort or panic in some appropriate way. -Dimitry --Apple-Mail=_74EFF5FB-06C1-4E9E-B720-B20CA9152046 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXlF//QAKCRCwXqMKLiCW o0psAKCTBducQdnim8tIXnlqDLYMD9U+uwCfcoy+vLWT9O/DJ9Kg/XZ8R/cQcl0= =QBIH -----END PGP SIGNATURE----- --Apple-Mail=_74EFF5FB-06C1-4E9E-B720-B20CA9152046--