From: Pierre Ossman Date: Wed, 3 Apr 2024 10:38:04 +0000 (+0200) Subject: Disable gcc NULL warning for context menu X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ceb60ad3d53c8bd3d9388d231f8054851d6f6a56;p=tigervnc.git 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. --- 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() {