pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that

From: neilc(at)svr1(dot)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that
Date: 2005-04-30 09:08:15
Message-ID: 20050430090815.4A52B5409F@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.

This patch fixes a bug in pg_dump (triggers with formatting sequences
in their names are not dumped correctly) and some related pg_dump
code that looks dubious; cleanups for more harmless instances have
been applied to more recent branches. This patch also fixes an
additional format string bug that is present in 7.2 but not in later
releases: pg_dump would also fail to correctly dump indexes with
formatting sequences in their names.

Tags:
----
REL7_2_STABLE

Modified Files:
--------------
pgsql/src/bin/pg_dump:
pg_backup_archiver.c (r1.42 -> r1.42.2.1)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.c.diff?r1=1.42&r2=1.42.2.1)
pg_dump.c (r1.241.2.3 -> r1.241.2.4)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_dump.c.diff?r1=1.241.2.3&r2=1.241.2.4)

Browse pgsql-committers by date

  From Date Subject
Next Message User Cmaj 2005-04-30 16:47:40 pgaccess - pgaccess: apply modified patch for pga_tables creation bug in
Previous Message Neil Conway 2005-04-30 08:42:18 pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that