aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav HÃ¥llberg <gustav@gmail.com>2008-12-31 18:42:30 (GMT)
committerGustav HÃ¥llberg <gustav@gmail.com>2009-01-16 23:37:02 (GMT)
commit7d440d48e6465ef859d3a88032b1d5c021ff9894 (patch)
treee4889250d7dcadca75e8dd0d992db224fdc0ff71
parent0e21ca9d04d9edd02fde19562d5b98fb38074092 (diff)
downloadpowwow-7d440d48e6465ef859d3a88032b1d5c021ff9894.zip
powwow-7d440d48e6465ef859d3a88032b1d5c021ff9894.tar.gz
powwow-7d440d48e6465ef859d3a88032b1d5c021ff9894.tar.bz2
when compiling with GCC, use attribute((format, (printf, ...)) for tty_printf
-rw-r--r--tty.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/tty.h b/tty.h
index ca4b554..9ef4d0b 100644
--- a/tty.h
+++ b/tty.h
@@ -40,9 +40,16 @@ void input_moveto __P ((int new_pos));
#else /* USE_LOCALE */
+#ifdef __GNUC__
+ #define PRINTF_FUNCTION(string, first) \
+ __attribute__ ((format (printf, string, first)))
+#else
+ #define PRINTF_FUNCTION(string, first)
+#endif
+
void tty_puts __P ((const char *s));
void tty_putc __P ((char c));
-void tty_printf __P ((const char *format, ...));
+void tty_printf __P ((const char *format, ...)) PRINTF_FUNCTION(1, 2);
int tty_read __P ((char *buf, size_t count));
void tty_gets __P ((char *s, int size));
void tty_flush __P ((void));