pgsql: Apply project best practices to switches over enum values. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Apply project best practices to switches over enum values.
Date
Msg-id E1iwE5S-0000B3-Ak@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Move some code from jsonapi.c to jsonfuncs.c.
Next
From: Thomas Munro
Date:
Subject: pgsql: Remove dependency on HeapTuple from predicate locking functions.