psql: Fix some scan-build warnings
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 12 Oct 2021 19:14:50 +0000 (21:14 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 12 Oct 2021 19:20:29 +0000 (21:20 +0200)
commit390edeeb570c01de1a14e2985ffed96de001e42e
treeb68773d8896d0b4b8494e4006b73003f6ba37848
parent00c61a74bcdbc04a3db721d53c7aff62244da198
psql: Fix some scan-build warnings

A repeated complaint was that scan-build thought that if the \timing
setting changes during processing of a query, the post-processing
might read garbage time values.  This is probably not possible right
now, but it's not entirely inconceivable given the code structure.  So
silence this warning with small restructuring that makes this more
robust.  The other warnings were a few dead stores that are easy to
remove.

Discussion: https://www.postgresql.org/message-id/2570e2ae-fa0f-aac9-f72f-bb59a9983a20@enterprisedb.com
src/bin/psql/common.c
src/bin/psql/copy.c
src/bin/psql/describe.c