diff --git a/decl.h b/decl.h index 6ba4274..930101a 100644 --- a/decl.h +++ b/decl.h @@ -94,12 +94,5 @@ #endif -/* Perform printf-style argument type checking for known compilers */ -#ifdef __GNUC__ -# define PRINTF_FORMAT(fmt_idx, arg_idx) __attribute__ \ - ((format (printf, fmt_idx, arg_idx))) -#else -# define PRINTF_FORMAT(fmt_idx, arg_idx) -#endif #endif /* !INCLUDE_DECL_H */ diff --git a/hist.c b/hist.c index 84c4147..6441b84 100644 --- a/hist.c +++ b/hist.c @@ -137,7 +137,7 @@ S_FUNC void uppercase_word(void); S_FUNC void lowercase_word(void); S_FUNC void ignore_char(void); S_FUNC void arrow_key(void); -S_FUNC void quit_calc(void); +S_FUNC void quit_calc(void) __attribute__((noreturn)); STATIC FUNC funcs[] = diff --git a/token.h b/token.h index 2e768bd..0177aa8 100644 --- a/token.h +++ b/token.h @@ -175,8 +175,8 @@ E_FUNC void inittokens(void); E_FUNC int tokenmode(int flag); E_FUNC int gettoken(void); E_FUNC void rescantoken(void); -E_FUNC void scanerror(int, char *, ...) PRINTF_FORMAT(2, 3); -E_FUNC void warning(char *, ...) PRINTF_FORMAT(1, 2); +E_FUNC void scanerror(int, char *, ...) __attribute__((format(printf, 2, 3))); +E_FUNC void warning(char *, ...) __attribute__((format(printf, 1, 2))); #endif /* !INCLUDE_TOKEN_H */ diff --git a/zfunc.c b/zfunc.c index 82b4120..cec8ad8 100644 --- a/zfunc.c +++ b/zfunc.c @@ -1411,7 +1411,7 @@ zlog10(ZVALUE z, BOOL *was_10_power) do { rel = zrel(*zp, z); if (rel == 0) { - /* quick exit - we match a tenpower entry */ + /* quick return - we match a tenpower entry */ if (was_10_power != NULL) { *was_10_power = TRUE; } diff --git a/zmath.h b/zmath.h index e76f9e2..d3e0295 100644 --- a/zmath.h +++ b/zmath.h @@ -41,6 +41,7 @@ # include "longbits.h" # include "byteswap.h" # include "have_stdlib.h" +# include "attribute.h" #else # include # include @@ -48,6 +49,7 @@ # include # include # include +# include #endif #ifdef HAVE_STDLIB_H # include @@ -625,13 +627,14 @@ E_FUNC char *math_getdivertedio(void); E_FUNC int math_setmode(int mode); E_FUNC int math_setmode2(int mode); E_FUNC LEN math_setdigits(LEN digits); -E_FUNC void math_fmt(char *, ...) PRINTF_FORMAT(1, 2); +E_FUNC void math_fmt(char *, ...) __attribute__((format(printf, 1, 2))); /* * The error routine. */ -E_FUNC void math_error(char *, ...) PRINTF_FORMAT(1, 2); +E_FUNC void math_error(char *, ...) \ + __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); /*