Fix more format truncation issues
Peter Eisentraut <peter_e@gmx.net>
Fix more format truncation issues Fix the warnings created by the compiler warning options -Wformat-overflow=2 -Wformat-truncation=2, supported since GCC 7. This is a more aggressive variant of the fixes in 6275f5d28a1577563f53f2171689d4f890a46881, which GCC 7 warned about by default. The issues are all harmless, but some dubious coding patterns are cleaned up. One issue that is of external interest is that BGW_MAXLEN is increased from 64 to 96. Apparently, the old value would cause the bgw_name of logical replication workers to be truncated in some circumstances. But this doesn't actually add those warning options. It appears that the warnings depend a bit on compilation and optimization options, so it would be annoying to have to keep up with that. This is more of a once-in-a-while cleanup. Reviewed-by: Michael Paquier <michael@paquier.xyz>
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pgstattuple/pgstattuple.c | modified | +1 −1 |
| src/backend/commands/explain.c | modified | +3 −2 |
| src/backend/libpq/be-secure-openssl.c | modified | +1 −1 |
| src/backend/utils/adt/dbsize.c | modified | +1 −1 |
| src/backend/utils/adt/float.c | modified | +10 −14 |
| src/backend/utils/adt/formatting.c | modified | +10 −23 |
| src/backend/utils/misc/guc.c | modified | +2 −2 |
| src/bin/initdb/initdb.c | modified | +3 −3 |
| src/bin/pgbench/pgbench.c | modified | +2 −2 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +1 −1 |
| src/bin/pg_dump/pg_backup_tar.c | modified | +1 −1 |
| src/include/postmaster/bgworker.h | modified | +1 −1 |
| src/interfaces/libpq/fe-secure-openssl.c | modified | +1 −1 |
| src/pl/tcl/pltcl.c | modified | +1 −1 |