From ceb60ad3d53c8bd3d9388d231f8054851d6f6a56 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 3 Apr 2024 12:38:04 +0200 Subject: [PATCH] Disable gcc NULL warning for context menu We use the pointer to just store an identifier for the menu, but this is enough for gcc to think we are using 0 instead of nullptr and complain. Even an explicit cast isn't enough to silence it here for some reason. --- vncviewer/Viewport.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index bbccc2f9..0c2cb862 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -1222,6 +1222,9 @@ void Viewport::resolveAltGrDetection(bool isAltGrSequence) } #endif +// FIXME: gcc confuses ID_DISCONNECT with NULL +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" void Viewport::initContextMenu() { contextMenu->clear(); @@ -1268,7 +1271,7 @@ void Viewport::initContextMenu() fltk_menu_add(contextMenu, p_("ContextMenu|", "About &TigerVNC viewer..."), 0, nullptr, (void*)ID_ABOUT, 0); } - +#pragma GCC diagnostic pop void Viewport::popupContextMenu() { -- 2.39.5