]> granicus.if.org Git - nethack/commitdiff
whitelist some macOS clang format-nonliteral warnings
authornhmall <nhmall@nethack.org>
Wed, 3 Feb 2021 00:50:07 +0000 (19:50 -0500)
committernhmall <nhmall@nethack.org>
Wed, 3 Feb 2021 00:50:07 +0000 (19:50 -0500)
src/end.c
src/hacklib.c
src/pline.c
sys/share/unixtty.c

index b71f0fb6a5effc36ff4c679504a52acd486a5c93..4005e459d7343e7326b724f2c02cade7b97844dc 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -550,6 +550,8 @@ fixup_death(int how)
 #define NOTIFY_NETHACK_BUGS
 #endif
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 /*VARARGS1*/
 void panic
 VA_DECL(const char *, str)
@@ -630,6 +632,8 @@ VA_DECL(const char *, str)
     really_done(PANICKED);
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 static boolean
 should_query_disclose_option(int category, char *defquery)
 {
index 12c2006a66c3df5b9047872725125e36402db35e..027f18cf167482a2bb319a43b3a2fdf3cfc6128e 100644 (file)
@@ -1257,6 +1257,8 @@ shuffle_int_array(int *indices, int count)
     }
 }
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 /*
  * Wrap snprintf for use in the main code.
  *
@@ -1292,4 +1294,6 @@ nh_snprintf(const char *func, int line, char *str, size_t size,
     }
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /*hacklib.c*/
index 2ce20d6247e0c8976dbbf03a2a4f7e47b9d89285..cfd2b94e1661d2a31c466643449ca413854d112b 100644 (file)
@@ -80,6 +80,8 @@ putmesg(const char *line)
 
 static void vpline(const char *, va_list);
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 void
 pline(const char *line, ...)
 {
@@ -199,6 +201,8 @@ pline_done:
     --in_pline;
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /* pline() variant which can override MSGTYPE handling or suppress
    message history (tty interface uses pline() to issue prompts and
    they shouldn't be blockable via MSGTYPE=hide) */
@@ -390,6 +394,8 @@ raw_printf(const char *line, ...)
     va_end(the_args);
 }
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 static void
 vraw_printf(const char *line, va_list the_args)
 {
@@ -450,6 +456,8 @@ impossible(const char *s, ...)
     g.program_state.in_impossible = 0;
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 #if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
 static boolean use_pline_handler = TRUE;
 
@@ -496,6 +504,8 @@ execplinehandler(const char *line)
  */
 static void vconfig_error_add(const char *, va_list);
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 void
 config_error_add(const char *str, ...)
 {
@@ -528,6 +538,8 @@ vconfig_error_add(const char *str, va_list the_args)
     config_erradd(buf);
 }
 
+RESTORE_WARNING_FORMAT_NONLITERAL
+
 /* nhassert_failed is called when an nhassert's condition is false */
 void
 nhassert_failed(const char *expression, const char *filepath, int line)
index dd5f5682a1daf12c6e52fe3af70577b8aa760c46..d731e1038fc1d082a6345edc31de860719a2eab3 100644 (file)
@@ -462,6 +462,8 @@ init_linux_cons(void)
 }
 #endif /* __linux__ */
 
+DISABLE_WARNING_FORMAT_NONLITERAL
+
 #ifndef __begui__ /* the Be GUI will define its own error proc */
 /* fatal error */
 void
@@ -480,3 +482,6 @@ error(const char *s, ...)
     exit(EXIT_FAILURE);
 }
 #endif /* !__begui__ */
+
+RESTORE_WARNING_FORMAT_NONLITERAL
+