diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-02-14 16:06:49 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-02-14 16:06:49 -0500 |
commit | 9a725f7b5cb7e8c8894ef121b49eff9c265245c8 (patch) | |
tree | 37e438b1542f8c1e1f57d78fa5cee47cd35357ce /src/bin/pgbench/pgbench.c | |
parent | 0c62356cc8777961221a643fa77f62e1c7361085 (diff) | |
download | postgresql-9a725f7b5cb7e8c8894ef121b49eff9c265245c8.tar.gz postgresql-9a725f7b5cb7e8c8894ef121b49eff9c265245c8.zip |
Silence assorted "variable may be used uninitialized" warnings.
All of these are false positives, but in each case a fair amount of
analysis is needed to see that, and it's not too surprising that not all
compilers are smart enough. (In particular, in the logtape.c case, a
compiler lacking the knowledge provided by the Assert would almost surely
complain, so that this warning will be seen in any non-assert build.)
Some of these are of long standing while others are pretty recent,
but it only seems worth fixing them in HEAD.
Jaime Casanova, tweaked a bit by me
Discussion: https://postgr.es/m/CAJGNTeMcYAMJdPAom52dppLMtF-UnEZi0dooj==75OEv1EoBZA@mail.gmail.com
Diffstat (limited to 'src/bin/pgbench/pgbench.c')
-rw-r--r-- | src/bin/pgbench/pgbench.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 31ea6ca06e0..d4209421f50 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -1495,6 +1495,7 @@ coerceToBool(PgBenchValue *pval, bool *bval) else /* NULL, INT or DOUBLE */ { fprintf(stderr, "cannot coerce %s to boolean\n", valueTypeName(pval)); + *bval = false; /* suppress uninitialized-variable warnings */ return false; } } @@ -1725,9 +1726,9 @@ evalLazyFunc(TState *thread, CState *st, * which do not require lazy evaluation. */ static bool -evalStandardFunc( - TState *thread, CState *st, - PgBenchFunction func, PgBenchExprLink *args, PgBenchValue *retval) +evalStandardFunc(TState *thread, CState *st, + PgBenchFunction func, PgBenchExprLink *args, + PgBenchValue *retval) { /* evaluate all function arguments */ int nargs = 0; |