Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fAmbM-0003ol-6k for pgsql-committers@arkaria.postgresql.org; Tue, 24 Apr 2018 01:18:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fAmbL-0003a0-3e for pgsql-committers@arkaria.postgresql.org; Tue, 24 Apr 2018 01:18:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fAmbK-0003Zr-RG for pgsql-committers@lists.postgresql.org; Tue, 24 Apr 2018 01:18:34 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fAmbH-00061y-Mk for pgsql-committers@lists.postgresql.org; Tue, 24 Apr 2018 01:18:33 +0000 Received: from [192.168.127.1] (port=62624 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1fAmbC-0008ET-Lf; Tue, 24 Apr 2018 01:18:26 +0000 Received: from [127.0.0.1] (port=49961 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1fAmbB-000Ltz-Pp; Tue, 24 Apr 2018 01:18:25 +0000 From: Andrew Gierth To: David Rowley Cc: Alvaro Herrera , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Remove useless default clause in switch In-Reply-To: (David Rowley's message of "Tue, 24 Apr 2018 12:27:27 +1200") Message-ID: <87fu3lbe12.fsf@news-spur.riddles.org.uk> References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Tue, 24 Apr 2018 02:18:24 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "David" == David Rowley writes: David> I always thought that when all options were covered that we David> generally kept a default just in case someone added another enum David> and forgot to update the code. That's what compiler warnings (-Wswitch, included in -Wall) are for; it's actually a _bad_ idea to have a default clause in such cases, since it stops the compiler from warning you. -- Andrew (irc:RhodiumToad)