Module Name: src
Committed By: joerg
Date: Tue Jan 7 02:11:30 UTC 2014
Modified Files:
src/external/bsd/tmux/dist: input.c log.c tmux.h
Log Message:
Format string verification
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tmux/dist/input.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tmux/dist/log.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tmux/dist/tmux.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/tmux/dist/input.c
diff -u src/external/bsd/tmux/dist/input.c:1.4 src/external/bsd/tmux/dist/input.c:1.5
--- src/external/bsd/tmux/dist/input.c:1.4 Wed Aug 17 19:28:36 2011
+++ src/external/bsd/tmux/dist/input.c Tue Jan 7 02:11:29 2014
@@ -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 <[email protected]>
@@ -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 *);
Index: src/external/bsd/tmux/dist/log.c
diff -u src/external/bsd/tmux/dist/log.c:1.2 src/external/bsd/tmux/dist/log.c:1.3
--- src/external/bsd/tmux/dist/log.c:1.2 Thu Aug 25 16:41:51 2011
+++ src/external/bsd/tmux/dist/log.c Tue Jan 7 02:11:29 2014
@@ -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 <[email protected]>
@@ -39,7 +39,7 @@ FILE *log_file;
/* 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_vwrite(int pri, const char *msg, va_
}
/* 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 @@ log_warn(const char *msg, ...)
free(fmt);
va_end(ap);
}
+#pragma GCC diagnostic push
/* Log a warning. */
void printflike1
Index: src/external/bsd/tmux/dist/tmux.h
diff -u src/external/bsd/tmux/dist/tmux.h:1.3 src/external/bsd/tmux/dist/tmux.h:1.4
--- src/external/bsd/tmux/dist/tmux.h:1.3 Sat Sep 17 01:50:08 2011
+++ src/external/bsd/tmux/dist/tmux.h Tue Jan 7 02:11:29 2014
@@ -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 <[email protected]>
@@ -80,6 +80,9 @@ extern char **environ;
#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 @@ void printflike3 screen_write_puts(struc
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_c
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 *xmalloc(size_t);
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 *);