Re: Use an enum for RELKIND_*? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use an enum for RELKIND_*?
Date
Msg-id 15760.1548340661@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use an enum for RELKIND_*?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Use an enum for RELKIND_*?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> I might misunderstand something, but my compiler (gcc 7.3.1)
> won't be quiet about omitted value even with default:.
> ...

I would call that a compiler bug, TBH.  The code is 100% correct,
if you intended to allow the default case to handle some enum
values, which is perfectly reasonable coding.

> Isn't it enough that at least one platform correctly warns that?

No, especially not if it's only a warning.  Many developers would
not see it initially, and the buildfarm likely wouldn't complain
either.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: using expression syntax for partition bounds
Next
From: Bruce Momjian
Date:
Subject: Re: Protect syscache from bloating with negative cache entries