* [PATCH] cleanup for gcc -Werror=format-security
@ 2009-01-05 11:07 Andrey Borzenkov
0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2009-01-05 11:07 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 2873 bytes --]
Recently Mandriva switched to using -Wformat -Werror=format-security as
default build flags, this made configure and compilation fail with
"format not a string literal and no format arguments". The patch below
makes it work again. All tests still passed :)
Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.114
diff -u -p -r1.114 configure.ac
--- configure.ac 1 Dec 2008 12:26:25 -0000 1.114
+++ configure.ac 5 Jan 2009 11:04:25 -0000
@@ -1477,27 +1477,27 @@ if test x$zsh_cv_path_term_header != xno
fi
AC_MSG_CHECKING(if boolcodes is available)
- AC_TRY_LINK($term_includes, [char **test = boolcodes;
printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = boolcodes; puts(*test);],
AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes, boolcodes=no)
AC_MSG_RESULT($boolcodes)
AC_MSG_CHECKING(if numcodes is available)
- AC_TRY_LINK($term_includes, [char **test = numcodes; printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = numcodes; puts(*test);],
AC_DEFINE(HAVE_NUMCODES) numcodes=yes, numcodes=no)
AC_MSG_RESULT($numcodes)
AC_MSG_CHECKING(if strcodes is available)
- AC_TRY_LINK($term_includes, [char **test = strcodes; printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = strcodes; puts(*test);],
AC_DEFINE(HAVE_STRCODES) strcodes=yes, strcodes=no)
AC_MSG_RESULT($strcodes)
AC_MSG_CHECKING(if boolnames is available)
- AC_TRY_LINK($term_includes, [char **test = boolnames;
printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = boolnames; puts(*test);],
AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes, boolnames=no)
AC_MSG_RESULT($boolnames)
AC_MSG_CHECKING(if numnames is available)
- AC_TRY_LINK($term_includes, [char **test = numnames; printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = numnames; puts(*test);],
AC_DEFINE(HAVE_NUMNAMES) numnames=yes, numnames=no)
AC_MSG_RESULT($numnames)
AC_MSG_CHECKING(if strnames is available)
- AC_TRY_LINK($term_includes, [char **test = strnames; printf(*test);],
+ AC_TRY_LINK($term_includes, [char **test = strnames; puts(*test);],
AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no)
AC_MSG_RESULT($strnames)
else
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.97
diff -u -p -r1.97 zle_tricky.c
--- Src/Zle/zle_tricky.c 12 Oct 2008 18:26:57 -0000 1.97
+++ Src/Zle/zle_tricky.c 5 Jan 2009 11:04:25 -0000
@@ -2286,7 +2286,7 @@ printfmt(char *fmt, int n, int dopr, int
case 'n':
sprintf(nc, "%d", n);
if (dopr)
- fprintf(shout, nc);
+ fputs(nc, shout);
cc += MB_METASTRWIDTH(nc);
break;
case 'B':
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-05 11:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-05 11:07 [PATCH] cleanup for gcc -Werror=format-security Andrey Borzenkov
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).