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 08:08:53
Message-ID: 20050430080853.59E1E5406E@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.

Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.

Modified Files:
--------------
pgsql/src/backend/utils/adt:
ruleutils.c (r1.193 -> r1.194)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c.diff?r1=1.193&r2=1.194)
pgsql/src/bin/initdb:
initdb.c (r1.82 -> r1.83)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/initdb/initdb.c.diff?r1=1.82&r2=1.83)
pgsql/src/bin/pg_dump:
dumputils.c (r1.16 -> r1.17)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/dumputils.c.diff?r1=1.16&r2=1.17)
pg_backup_archiver.c (r1.107 -> r1.108)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.c.diff?r1=1.107&r2=1.108)
pg_dump.c (r1.407 -> r1.408)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_dump.c.diff?r1=1.407&r2=1.408)

Browse pgsql-committers by date

  From Date Subject
Next Message Neil Conway 2005-04-30 08:19:45 pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that
Previous Message Neil Conway 2005-04-30 08:02:03 pgsql: This patch fixes a bug in the error message emitted by pg_restore