Re: BUG #16823: Unreachable code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ruga(at)protonmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16823: Unreachable code
Date: 2021-01-13 16:42:06
Message-ID: 1284342.1610556126@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> localtime.c:135:40: warning: code will never be executed
> [-Wunreachable-code]
> result -= !TWOS_COMPLEMENT(int32) && result != 0;
> ^~~~~~

[ and much more in the same vein ]

We're unlikely to change any of these, so I'd recommend turning off
-Wunreachable-code.

localtime.c is a clone of the IANA timezone code, so we're certainly
not going to change it unless they do (which I doubt they would).
bootparse.c, and some of the other files you mention, are code generated
by bison, which we have no control over. Most of the rest of these
are already manually commented as being unreachable; they're there
partly for belt-and-suspenders reasons, and partly because some other
compilers will warn if we don't have them.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-01-13 22:13:55 BUG #16824: Planner chooses poor path on query with Merge Join and pagination
Previous Message Tom Lane 2021-01-13 16:26:39 Re: BUG #16820: PG will have a deadlock when multiple rows are updated concurrently