From owner-dev-commits-src-all@freebsd.org Mon Jan 11 19:36:35 2021 Return-Path: Delivered-To: dev-commits-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 6145B4E3FE6; Mon, 11 Jan 2021 19:36:35 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF3qP6rnDz4lBb; Mon, 11 Jan 2021 19:36:33 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qt1-f172.google.com with SMTP id a6so115427qtw.6; Mon, 11 Jan 2021 11:36:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rLF97UMWs/9WyMP6zw+MHFEl/7QQWyol2vahNNGiXFA=; b=AiMWnY2KZ9HXOMFK2yoCgL7xIaSO0E7WW6KFia+l4m8GV9mrvUh0BGXjO5zmzlYRdI 3Ceyt4VZEG0xQYZ6iYpwHtKoqQpsysJFOOaIhYjbGrguLcLJV1GJFfeyB5cRXZ6UXyP4 02qAwqu5COGJn9lBkkIN53NMQQptVD55/LTwc3xodF8PHvZ6DhZm1MDpPF+pJA1ZOMid fCsPmJ4ek1bdysCUtJGkFpuDlFNBnEmov7v09THycRDQFPXNIsAE4duRPFiM7e+RrRha K9Tv0xxsg1StF4ztiTs01MC26S3LkApxSM3QHy75BHjUiWdPjGOaZGowejjj8kpmyN1L LmPg== X-Gm-Message-State: AOAM531HYK8FNAtHUKKqz491lsM6o0LEnHgDaZrrMdO3nEs7VNrTsVpj 2j/olJdMK8mPHnHttaDGAMr5fCclg87YHg== X-Google-Smtp-Source: ABdhPJyRqhJt33ocBrfRWwtGEOqFMVxxVUd+k652V4lc000Xu99zu7N1fg3+pvEP7Cg8pP4EWIy/uw== X-Received: by 2002:a05:622a:1cb:: with SMTP id t11mr1166410qtw.282.1610393792159; Mon, 11 Jan 2021 11:36:32 -0800 (PST) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com. [209.85.160.181]) by smtp.gmail.com with ESMTPSA id q27sm416879qkj.131.2021.01.11.11.36.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 11:36:30 -0800 (PST) Received: by mail-qt1-f181.google.com with SMTP id r9so94959qtp.11; Mon, 11 Jan 2021 11:36:30 -0800 (PST) X-Received: by 2002:ac8:70c:: with SMTP id g12mr1202568qth.140.1610393790511; Mon, 11 Jan 2021 11:36:30 -0800 (PST) MIME-Version: 1.0 References: <202101110554.10B5sW2q070743@gitrepo.freebsd.org> <700dd42d-2d73-e54a-5fcc-b62ed31df80d@FreeBSD.org> <915475fa-0072-2303-dfc9-dbeb42224434@kondratyev.su> <486B154B-376A-4000-8946-844353D8504E@freebsd.org> In-Reply-To: <486B154B-376A-4000-8946-844353D8504E@freebsd.org> From: Ryan Libby Date: Mon, 11 Jan 2021 11:36:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 16079c7233be - main - hid: quiet -Wswitch To: Jessica Clarke Cc: Vladimir Kondratyev , John Baldwin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DF3qP6rnDz4lBb 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 19:36:36 -0000 On Mon, Jan 11, 2021 at 11:22 AM Jessica Clarke wrote: > > On 11 Jan 2021, at 19:14, Vladimir Kondratyev wrote: > > On 11.01.2021 21:03, John Baldwin wrote: > >> On 1/10/21 9:54 PM, Ryan Libby wrote: > >>> The branch main has been updated by rlibby: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=16079c7233be8bd6c88e3421a70c7ca87cfea370 > >>> > >>> commit 16079c7233be8bd6c88e3421a70c7ca87cfea370 > >>> Author: Ryan Libby > >>> AuthorDate: 2021-01-11 05:53:15 +0000 > >>> Commit: Ryan Libby > >>> CommitDate: 2021-01-11 05:53:15 +0000 > >>> > >>> hid: quiet -Wswitch > >>> > >>> Gcc builds complained that not all switch cases are handled. Add > >>> default cases to appease gcc. > >>> > >>> Reviewed by: hselasky (previous version), wulf > >>> Sponsored by: Dell EMC Isilon > >>> Differential Revision: https://reviews.freebsd.org/D28082 > >> > >> If these cases are never reachable, then I think '__assert_unreachable()' > >> is preferred to a plain break. > >> > > These cases are reachable. They are NOP steps of state machine. > > How many states are there? It might be better to document that using an > explicit set of case labels that just immediately break (and then > -Wswitch will help you in future in case you ever forget to update one > of the switch statements). Where possible -Wswitch is best fixed, not > silenced with default, though there are times when the latter is > preferable. > > Jess > There are currently two other enum values, and four total. I agree with your and John's points in general. In this case, this was specifically discussed in review and reviewers requested use of default. >From my perspective, if that's what maintainers prefer after having considered the options, use of default is acceptable.