From 7d440d48e6465ef859d3a88032b1d5c021ff9894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20H=C3=A5llberg?= Date: Wed, 31 Dec 2008 13:42:30 -0500 Subject: when compiling with GCC, use attribute((format, (printf, ...)) for tty_printf 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)); -- cgit v0.10.2