Skip to content

Commit 7a58167

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 parent 7e48b77 commit 7a58167

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+
static const char *err_gettext(const char *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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy