From owner-dev-commits-src-main@freebsd.org Mon Jan 11 20:56:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D92F54E59FE; Mon, 11 Jan 2021 20:56:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF5bc5FPPz4rth; Mon, 11 Jan 2021 20:56:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 009A126012D; Mon, 11 Jan 2021 21:56:25 +0100 (CET) Subject: Re: git: 16079c7233be - main - hid: quiet -Wswitch To: Ryan Libby , Vladimir Kondratyev , John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101110554.10B5sW2q070743@gitrepo.freebsd.org> <700dd42d-2d73-e54a-5fcc-b62ed31df80d@FreeBSD.org> From: Hans Petter Selasky Message-ID: <4a6b1780-b3df-29f7-6062-05c6e81231da@selasky.org> Date: Mon, 11 Jan 2021 21:56:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DF5bc5FPPz4rth X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 20:56:28 -0000 On 1/11/21 8:05 PM, Ryan Libby wrote: >> If these cases are never reachable, then I think '__assert_unreachable()' >> is preferred to a plain break. > Hi, > I'll have to let wulf and hselasky speak to that... __assert_unreachable() is a bit fresh in my opinion. Basically it comes down to a panic/assert when supposedly unreached cases are triggered. commit c79cee71363ddaeb3c5ab7d3ccb87a11e1860d95 Author: Kyle Evans Date: Wed May 13 18:07:37 2020 +0000 kernel: provide panicky version of __unreachable I think: default: break; Or when you need: /* FALLTHROUGH */ is perfectly fine, even though I see other OS'es even macrofy FALLTHROUGH as a built in compiler attribute. Why do a) and not b) ? Are there more things about switch cases we should do? --HPS