pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Apply project best practices to switches over enum values.
Date: Mon, 27 Jan 2020 23:46:34 +0000
Message-ID: <E1iwE5S-0000B3-Ak@gemulon.postgresql.org> (raw)

Apply project best practices to switches over enum values.

In the wake of 1f3a02173, assorted buildfarm members were warning about
"control reaches end of non-void function" or the like.  Do what we've
done elsewhere: in place of a "default" switch case that will prevent
the compiler from warning about unhandled enum values, put a catchall
elog() after the switch.  And return a dummy value to satisfy compilers
that don't know elog() doesn't return.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4589c6a2a30faba53d0655a8e3a29b54d28bb6f6

Modified Files
--------------
src/backend/utils/adt/jsonapi.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)



Message-ID: <E1iwE5S-0000B3-Ak@gemulon.postgresql.org>
Permalink:  ../E1iwE5S-0000B3-Ak@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iwE5S-0000B3-Ak@gemulon.postgresql.org

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Apply project best practices to switches over enum values.
  In-Reply-To: <E1iwE5S-0000B3-Ak@gemulon.postgresql.org>
  References: <E1iwE5S-0000B3-Ak@gemulon.postgresql.org>

* 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