From 61d3cdbb34ed7ebaa9a9a3c4f13595488b80c8f5 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Mon, 18 Jul 2011 14:56:57 +0000 Subject: Bug 4812 - GCC __attribute__ annotations for printf, non-returning functions etc., patch by linux@youmustbejoking.demon.co.uk and Zack Middleton --- src/qcommon/vm_x86_64_assembler.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/qcommon/vm_x86_64_assembler.c') diff --git a/src/qcommon/vm_x86_64_assembler.c b/src/qcommon/vm_x86_64_assembler.c index ad2aeea5..2fb67cf1 100644 --- a/src/qcommon/vm_x86_64_assembler.c +++ b/src/qcommon/vm_x86_64_assembler.c @@ -32,6 +32,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include +// Ignore __attribute__ on non-gcc platforms +#ifndef __GNUC__ +#ifndef __attribute__ +#define __attribute__(x) +#endif +#endif + typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; @@ -57,7 +64,7 @@ static FILE* fout; #define debug(fmt, args...) #endif -static void _crap(const char* func, const char* fmt, ...) +static __attribute__ ((noreturn)) __attribute__ ((format (printf, 2, 3))) void _crap(const char* func, const char* fmt, ...) { va_list ap; fprintf(stderr, "%s() - ", func); -- cgit