Re: pgsql: Remove useless default clause in switch - Mailing list pgsql-committers

From Andrew Gierth
Subject Re: pgsql: Remove useless default clause in switch
Date
Msg-id 87fu3lbe12.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: pgsql: Remove useless default clause in switch  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-committers
>>>>> "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)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Remove useless default clause in switch
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Remove useless default clause in switch