]> granicus.if.org Git - nethack/commitdiff
more macOS whitelisting
authornhmall <nhmall@nethack.org>
Wed, 3 Feb 2021 01:11:43 +0000 (20:11 -0500)
committernhmall <nhmall@nethack.org>
Wed, 3 Feb 2021 01:11:43 +0000 (20:11 -0500)
X11, Qt, and util

also ensure the functional warnings.h macro definitions are used
with c++ clang compiler

include/warnings.h
util/panic.c
win/Qt/qt_stat.cpp
win/X11/winstat.c

index 8559f0d4321dbfb0f18943b69b97f919bfa041f7..f0cab3de44e4cc92e7a3c193c46f1cb0fa59019f 100644 (file)
 #define ACTIVATE_WARNING_PRAGMAS
 #endif
 #endif
+#if defined(__clang__) && defined(__cplusplus)
+#ifndef ACTIVATE_WARNING_PRAGMAS
+#define ACTIVATE_WARNING_PRAGMAS
+#endif
+#endif
 
 #ifdef ACTIVATE_WARNING_PRAGMAS
 #if defined(__clang__)
index 6d5d93f4170852dfd59a455fa7829ab60408b793..d598e03780b24652a5757d12ce965a0c902d462a 100644 (file)
@@ -22,6 +22,8 @@ extern void vms_abort(void);
 boolean panicking;
 void panic(const char *, ...);
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 void panic
 VA_DECL(const char *, str)
 {
@@ -46,6 +48,8 @@ VA_DECL(const char *, str)
     exit(EXIT_FAILURE); /* redundant */
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 #ifdef ALLOCA_HACK
 /*
  * In case bison-generated foo_yacc.c tries to use alloca(); if we don't
index 3fca92c89ddf0778f2f0854406968090bec96c03..edbda992ef2acd612dd37d1c914baec339c66739 100644 (file)
@@ -565,6 +565,8 @@ QHBoxLayout *NetHackQtStatusWindow::InitHitpointBar()
     return hpbar; // caller will add our result to vbox layout
 }
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 // when hitpoint bar is enabled, calculate and draw it, otherwise remove it
 void NetHackQtStatusWindow::HitpointBar()
 {
@@ -665,6 +667,8 @@ void NetHackQtStatusWindow::HitpointBar()
     }
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /*
  * Update the displayed status.  The current code in botl.c updates
  * two lines of information.  Both lines are always updated one after
index d876f55c0f8a2433b2fcc9b633e63e05bda8a732..c4c8adb6e29d14f18f71e4a58ff69a7cb27925a2 100644 (file)
@@ -642,6 +642,8 @@ tt_status_fixup(void)
     XtGetValues(X11_status_labels[0], args, num_args);
 }
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 /* core requests updating one status field (or is indicating that it's time
    to flush all updated fields); tty-style handling */
 static void
@@ -810,6 +812,8 @@ X11_status_update_tty(int fld, genericptr_t ptr, int chg UNUSED, int percent,
     (void) XFlush(XtDisplay(X11_status_labels[0]));
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /*ARGSUSED*/
 static void
 X11_status_update_fancy(int fld, genericptr_t ptr, int chg UNUSED,
@@ -1444,6 +1448,8 @@ hilight_label(Widget w) /* label widget */
     swap_fg_bg(w);
 }
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 static void
 update_val(struct X_status_value *attr_rec, long new_value)
 {
@@ -1652,6 +1658,8 @@ update_val(struct X_status_value *attr_rec, long new_value)
     }
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /* overloaded condition is being cleared without going through update_val()
    so that an alternate can be shown; put this one back to default settings */
 static void