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

From neilc@svr1.postgresql.org (Neil Conway)
Subject pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that
Date
Msg-id 20050430080853.59E1E5406E@svr1.postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: neilc@svr1.postgresql.org (Neil Conway)
Date:
Subject: pgsql: This patch fixes a bug in the error message emitted by pg_restore
Next
From: neilc@svr1.postgresql.org (Neil Conway)
Date:
Subject: pgsql: GCC 4.0 includes a new warning option, -Wformat-literal, that