From 24914ec7dfa6bcfaebad96deae9df8d81d9be7ba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Aug 2020 22:29:17 +0200 Subject: [PATCH] Suppress unavoidable -Wformat-literal in wx[F]printf() Disable gcc format string checks inside these functions. --- include/wx/wxcrtvararg.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/wx/wxcrtvararg.h b/include/wx/wxcrtvararg.h index 4d998df14f..38bbb241c2 100644 --- a/include/wx/wxcrtvararg.h +++ b/include/wx/wxcrtvararg.h @@ -276,6 +276,8 @@ #endif +wxGCC_ONLY_WARNING_SUPPRESS(format-nonliteral) + WX_DEFINE_VARARG_FUNC_SANS_N0(int, wxPrintf, 1, (const wxFormatString&), wxCRT_PrintfNative, wxCRT_PrintfA) inline int wxPrintf(const wxFormatString& s) @@ -290,6 +292,8 @@ inline int wxFprintf(FILE *f, const wxFormatString& s) return wxFprintf(f, wxASCII_STR("%s"), s.InputAsString()); } +wxGCC_ONLY_WARNING_RESTORE(format-nonliteral) + // va_list versions of printf functions simply forward to the respective // CRT function; note that they assume that va_list was created using // wxArgNormalizer!