diff --git a/firmware/export/panic.h b/firmware/export/panic.h index fd63687606..fa8f854cd5 100644 --- a/firmware/export/panic.h +++ b/firmware/export/panic.h @@ -20,6 +20,8 @@ #ifndef __PANIC_H__ #define __PANIC_H__ -void panicf( const char *fmt, ... ); +#include "_ansi.h" + +void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2); #endif /* __PANIC_H__ */ diff --git a/firmware/include/_ansi.h b/firmware/include/_ansi.h index 11c712f84e..449001f74d 100644 --- a/firmware/include/_ansi.h +++ b/firmware/include/_ansi.h @@ -72,4 +72,6 @@ #define _ATTRIBUTE(attrs) #endif +#define ATTRIBUTE_PRINTF(fmt, arg1) _ATTRIBUTE( ( format( printf, fmt, arg1 ) ) ) + #endif /* _ANSIDECL_H_ */ diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h index b667a0406b..9f2ea7b404 100644 --- a/firmware/include/sprintf.h +++ b/firmware/include/sprintf.h @@ -22,12 +22,7 @@ #include #include - -#ifdef __GNUC__ -#define ATTRIBUTE_PRINTF(fmt, arg1) __attribute__ ( ( format( printf, fmt, arg1 ) ) ) -#else -#define ATTRIBUTE_PRINTF(fmt, arg1) -#endif +#include <_ansi.h> int snprintf (char *buf, size_t size, const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4);