Re: BUG #16823: Unreachable code

From: Rupert Gallagher <ruga(at)protonmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16823: Unreachable code
Date: 2021-01-17 22:51:35
Message-ID: WJpmGmzruGYMZrg6OKdz3LZdOrt9-98t163B5FXp7Fpl2ztBQQWc6RsPk4LIxQi69_DNPfSBVbVaYcyy4mFGWA1ArKwddW1DZGscSnMQHpg=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Turning off the warning will not make the code reachable. Non reachable means that it will never be executed. If you are sure that it is ok to never execute it, then remove it.

-------- Original Message --------
On Jan 13, 2021, 17:42, Tom Lane < tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
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

Browse pgsql-bugs by date

  From Date Subject
Next Message Mihir Pandya 2021-01-18 05:13:14 Re: BUG #16822: Unable to launch setup
Previous Message Alexander Korotkov 2021-01-17 21:24:19 Re: BUG #16828: duplicate results when using ** recursive expression in JSON path