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

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

From
neilc@svr1.postgresql.org (Neil Conway)
Date:
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)