* [PATCH] builtin-receive-pack.c: fix compiler warnings about format string
@ 2009-02-15 18:18 René Scharfe
2009-02-15 19:34 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2009-02-15 18:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
While all of the strings passed to warning() are, in fact, literals, the
compiler doesn't recognize them as such because it doesn't see through
the loop used to iterate over them:
builtin-receive-pack.c: In function 'warn_unconfigured_deny':
builtin-receive-pack.c:247: warning: format not a string literal and no format arguments
builtin-receive-pack.c: In function 'warn_unconfigured_deny_delete_current':
builtin-receive-pack.c:273: warning: format not a string literal and no format arguments
Calm the compiler by adding easily recognizable format string literals.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
builtin-receive-pack.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-receive-pack.c b/builtin-receive-pack.c
index f7e04c4..849f1fe 100644
--- a/builtin-receive-pack.c
+++ b/builtin-receive-pack.c
@@ -244,7 +244,7 @@ static void warn_unconfigured_deny(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(warn_unconfigured_deny_msg); i++)
- warning(warn_unconfigured_deny_msg[i]);
+ warning("%s", warn_unconfigured_deny_msg[i]);
}
static char *warn_unconfigured_deny_delete_current_msg[] = {
@@ -270,7 +270,7 @@ static void warn_unconfigured_deny_delete_current(void)
for (i = 0;
i < ARRAY_SIZE(warn_unconfigured_deny_delete_current_msg);
i++)
- warning(warn_unconfigured_deny_delete_current_msg[i]);
+ warning("%s", warn_unconfigured_deny_delete_current_msg[i]);
}
static const char *update(struct command *cmd)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-15 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-15 18:18 [PATCH] builtin-receive-pack.c: fix compiler warnings about format string René Scharfe
2009-02-15 19:34 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).