From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove useless default clause in switch
Date: Tue, 24 Apr 2018 02:18:24 +0100
Message-ID: <87fu3lbe12.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAKJS1f9vS7W0MDp-DJ0ixg3bMhJo0vdU-vzjZR3CumvtaTP9cg@mail.gmail.com>
References: <E1fAd8s-0003wZ-AV@gemulon.postgresql.org>
<CAKJS1f9vS7W0MDp-DJ0ixg3bMhJo0vdU-vzjZR3CumvtaTP9cg@mail.gmail.com>
>>>>> "David" == David Rowley <david.rowley@2ndquadrant.com> 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@tao11.riddles.org.uk, david.rowley@2ndquadrant.com, alvherre@alvh.no-ip.org
Subject: Re: pgsql: Remove useless default clause in switch
In-Reply-To: <87fu3lbe12.fsf@news-spur.riddles.org.uk>
References: <E1fAd8s-0003wZ-AV@gemulon.postgresql.org> <CAKJS1f9vS7W0MDp-DJ0ixg3bMhJo0vdU-vzjZR3CumvtaTP9cg@mail.gmail.com> <87fu3lbe12.fsf@news-spur.riddles.org.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox