Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a58167

Browse files
committed
Add __attribute__((format_arg(1))) to the declaration of err_gettext(),
to restore gcc's ability to crosscheck format arguments within elog.c.Noted in a test compilation with -Wformat-nonliteral enabled.
1 parent7e48b77 commit7a58167

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
*
4444
* IDENTIFICATION
45-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.215 2009/06/11 14:49:05 momjian Exp $
45+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.216 2009/06/25 23:07:15 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -75,6 +75,11 @@
7575
#undef _
7676
#define_(x) err_gettext(x)
7777

78+
staticconstchar*err_gettext(constchar*str)
79+
/* This extension allows gcc to check the format string for consistency with
80+
the supplied arguments. */
81+
__attribute__((format_arg(1)));
82+
7883
/* Global variables */
7984
ErrorContextCallback*error_context_stack=NULL;
8085

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp