From 33ac7a346e9134e27d26c88fc0693f16b1c55deb Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 10 Sep 2021 14:22:24 +0000 Subject: Get rid of the last two warnings by turning them off around the problem statements, if the compiler supports it. --- tmux.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 7a77cdae..6c7cf046 100644 --- a/tmux.h +++ b/tmux.h @@ -93,6 +93,20 @@ struct winlink; #define DEFAULT_XPIXEL 16 #define DEFAULT_YPIXEL 32 +/* Don't complain about format arguments. */ +#if __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#define no_format_nonliteral(x) do { \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wformat-nonliteral\"") \ + x; \ + _Pragma ("GCC diagnostic pop") \ +} while (0) +#else +#define no_format_nonliteral(x) do { \ + x; \ +} while (0) +#endif + /* Attribute to make GCC check printf-like arguments. */ #define printflike(a, b) __attribute__ ((format (printf, a, b))) -- cgit