From a36136ec4d9056a32a9547c3abcc22ee7e1b3c32 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Mon, 25 Aug 2014 01:06:01 +0200 Subject: [PATCH] Annotate unused variables Signed-off-by: Thomas Graf --- include/bmon/bmon.h | 2 ++ src/in_proc.c | 2 +- src/out_curses.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/bmon/bmon.h b/include/bmon/bmon.h index e349110..05934ec 100644 --- a/include/bmon/bmon.h +++ b/include/bmon/bmon.h @@ -60,9 +60,11 @@ enum { #if defined __GNUC__ #define __init __attribute__ ((constructor)) #define __exit __attribute__ ((destructor)) +#define __unused__ __attribute__ ((unused)) #else #define __init #define __exit +#define __unused__ #endif #ifdef DEBUG diff --git a/src/in_proc.c b/src/in_proc.c index aead5ce..b14269b 100644 --- a/src/in_proc.c +++ b/src/in_proc.c @@ -101,7 +101,7 @@ static void proc_read(void) { struct element *e; FILE *fd; - char buf[512], *p, *s, *unused; + char buf[512], *p, *s, *unused __unused__; int w; if (!(fd = fopen(c_path, "r"))) diff --git a/src/out_curses.c b/src/out_curses.c index cbd19ae..c973789 100644 --- a/src/out_curses.c +++ b/src/out_curses.c @@ -148,7 +148,7 @@ static void put_line(const char *fmt, ...) { va_list args; char buf[2048]; - int x, y; + int x, y __unused__; memset(buf, 0, sizeof(buf)); getyx(stdscr, y, x);