Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tmux/dist Format string verification



details:   https://anonhg.NetBSD.org/src/rev/3a81d4d4ab62
branches:  trunk
changeset: 792545:3a81d4d4ab62
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Jan 07 02:11:29 2014 +0000

description:
Format string verification

diffstat:

 external/bsd/tmux/dist/input.c |   4 ++--
 external/bsd/tmux/dist/log.c   |   7 +++++--
 external/bsd/tmux/dist/tmux.h  |  17 ++++++++++-------
 3 files changed, 17 insertions(+), 11 deletions(-)

diffs (110 lines):

diff -r 5ab5f4336fa2 -r 3a81d4d4ab62 external/bsd/tmux/dist/input.c
--- a/external/bsd/tmux/dist/input.c    Tue Jan 07 02:10:49 2014 +0000
+++ b/external/bsd/tmux/dist/input.c    Tue Jan 07 02:11:29 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.4 2011/08/17 19:28:36 jmmv Exp $ */
+/* $Id: input.c,v 1.5 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -49,7 +49,7 @@
 /* Helper functions. */
 int    input_split(struct input_ctx *);
 int    input_get(struct input_ctx *, u_int, int, int);
-void   input_reply(struct input_ctx *, const char *, ...);
+void   input_reply(struct input_ctx *, const char *, ...) __printflike(2, 3);
 
 /* Transition entry/exit handlers. */
 void   input_clear(struct input_ctx *);
diff -r 5ab5f4336fa2 -r 3a81d4d4ab62 external/bsd/tmux/dist/log.c
--- a/external/bsd/tmux/dist/log.c      Tue Jan 07 02:10:49 2014 +0000
+++ b/external/bsd/tmux/dist/log.c      Tue Jan 07 02:11:29 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: log.c,v 1.2 2011/08/25 16:41:51 joerg Exp $ */
+/* $Id: log.c,v 1.3 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -39,7 +39,7 @@
 /* Debug level. */
 int    log_level;
 
-void            log_vwrite(int, const char *, va_list);
+void            log_vwrite(int, const char *, va_list) __printflike(2, 0);
 __dead void     log_vfatal(const char *, va_list);
 
 /* Open logging to tty. */
@@ -105,6 +105,8 @@
 }
 
 /* Log a warning with error string. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 void printflike1
 log_warn(const char *msg, ...)
 {
@@ -118,6 +120,7 @@
        free(fmt);
        va_end(ap);
 }
+#pragma GCC diagnostic push
 
 /* Log a warning. */
 void printflike1
diff -r 5ab5f4336fa2 -r 3a81d4d4ab62 external/bsd/tmux/dist/tmux.h
--- a/external/bsd/tmux/dist/tmux.h     Tue Jan 07 02:10:49 2014 +0000
+++ b/external/bsd/tmux/dist/tmux.h     Tue Jan 07 02:11:29 2014 +0000
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.3 2011/09/17 01:50:08 christos Exp $ */
+/* $Id: tmux.h,v 1.4 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -80,6 +80,9 @@
 #define unused __attribute__ ((unused))
 
 /* Attribute to make gcc check printf-like arguments. */
+#define vprintflike2 __attribute__ ((format (printf, 2, 0)))
+#define vprintflike3 __attribute__ ((format (printf, 3, 0)))
+#define vprintflike5 __attribute__ ((format (printf, 5, 0)))
 #define printflike1 __attribute__ ((format (printf, 1, 2)))
 #define printflike2 __attribute__ ((format (printf, 2, 3)))
 #define printflike3 __attribute__ ((format (printf, 3, 4)))
@@ -1803,7 +1806,7 @@
             struct grid_cell *, const char *, ...);
 void printflike5 screen_write_nputs(struct screen_write_ctx *,
             ssize_t, struct grid_cell *, int, const char *, ...);
-void    screen_write_vnputs(struct screen_write_ctx *,
+void vprintflike5 screen_write_vnputs(struct screen_write_ctx *,
             ssize_t, struct grid_cell *, int, const char *, va_list);
 void    screen_write_parsestyle(
             struct grid_cell *, struct grid_cell *, const char *);
@@ -1980,13 +1983,13 @@
 extern const struct window_mode window_copy_mode;
 void            window_copy_init_from_pane(struct window_pane *);
 void            window_copy_init_for_output(struct window_pane *);
-void            window_copy_add(struct window_pane *, const char *, ...);
-void            window_copy_vadd(struct window_pane *, const char *, va_list);
+void printflike2 window_copy_add(struct window_pane *, const char *, ...);
+void vprintflike2 window_copy_vadd(struct window_pane *, const char *, va_list);
 void            window_copy_pageup(struct window_pane *);
 
 /* window-choose.c */
 extern const struct window_mode window_choose_mode;
-void            window_choose_vadd(
+void vprintflike3 window_choose_vadd(
                     struct window_pane *, int, const char *, va_list);
 void printflike3 window_choose_add(
                     struct window_pane *, int, const char *, ...);
@@ -2066,9 +2069,9 @@
 void           *xrealloc(void *, size_t, size_t);
 void            xfree(void *);
 int printflike2         xasprintf(char **, const char *, ...);
-int             xvasprintf(char **, const char *, va_list);
+int vprintflike2 xvasprintf(char **, const char *, va_list);
 int printflike3         xsnprintf(char *, size_t, const char *, ...);
-int             xvsnprintf(char *, size_t, const char *, va_list);
+int vprintflike3 xvsnprintf(char *, size_t, const char *, va_list);
 
 /* utmp.c */
 struct window_utmp *utmp_create(const char *);



Home | Main Index | Thread Index | Old Index