From a028ea14ae9d3492411871b9f49ed4dca79b1b0f Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 27 Oct 2020 04:27:55 +0000 Subject: [PATCH] Restore format(printf) attribute for powerup_basic Kreeblah reports that clang now warns for powerup.cpp due to a missing __attribute_format_printf. This was incorrectly dropped in ffb653c0b810bac5e1229f91ecedae515ae329e2. gcc did not warn, but clang now warns. Add back the attribute. Fixes: ffb653c0b810bac5e1229f91ecedae515ae329e2 ("Pass control_info & to various functions") Reported-by: Kreeblah --- common/main/powerup.h | 1 - similar/main/powerup.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/main/powerup.h b/common/main/powerup.h index 438ce8ca1..027cebd48 100644 --- a/common/main/powerup.h +++ b/common/main/powerup.h @@ -162,6 +162,5 @@ extern void do_megawow_powerup(int quantity); void powerup_basic_str(int redadd, int greenadd, int blueadd, int score, const char *str) __attribute_nonnull(); } #endif -#define powerup_basic(A1,A2,A3,A4,F,...) dxx_call_printf_checked(powerup_basic,powerup_basic_str,(A1,A2,A3,A4),(F),##__VA_ARGS__) #endif diff --git a/similar/main/powerup.cpp b/similar/main/powerup.cpp index 00fc3afe2..8bd9143bd 100644 --- a/similar/main/powerup.cpp +++ b/similar/main/powerup.cpp @@ -140,6 +140,8 @@ static void _powerup_basic_nonhud(int redadd, int greenadd, int blueadd, int sco add_points_to_score(ConsoleObject->ctype.player_info, score); } +#define powerup_basic(A1,A2,A3,A4,F,...) dxx_call_printf_checked(powerup_basic,powerup_basic_str,(A1,A2,A3,A4),(F),##__VA_ARGS__) +__attribute_format_printf(5, 6) void (powerup_basic)(int redadd, int greenadd, int blueadd, int score, const char *format, ...) { va_list args;