From e1ee404ecc46708919ec3eb428359966ba777f59 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 16 May 2026 09:05:29 -0400 Subject: [PATCH] warning workaround led to a build error on some platforms & compilers Use another method for the warning workaround. allmain.c:33:56: error: 'maybe_unused' attribute cannot be applied to types 33 | early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT) | ^ allmain.c:28:30: note: expanded from macro 'USED_FOR_CRASHREPORT' 28 | #define USED_FOR_CRASHREPORT UNUSED | ^ ../include/tradstdc.h:510:16: note: expanded from macro 'UNUSED' 510 | #define UNUSED ATTRUNUSED | ^ ../include/tradstdc.h:397:22: note: expanded from macro 'ATTRUNUSED' 397 | #define ATTRUNUSED [[maybe_unused]] | ^ allmain.c:33:49: warning: unused parameter 'argv' [-Wunused-parameter] 33 | early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT) | ^ 1 warning and 1 error generated. --- src/allmain.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/allmain.c b/src/allmain.c index f7ee742ad..5c573da4b 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -22,15 +22,9 @@ staticfn void regen_pw(int); staticfn void regen_hp(int); staticfn void interrupt_multi(const char *); -#ifdef CRASHREPORT -#define USED_FOR_CRASHREPORT -#else -#define USED_FOR_CRASHREPORT UNUSED -#endif - /*ARGSUSED*/ void -early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT) +early_init(int argc, char *argv[]) { program_state_init(); #ifdef CRASHREPORT @@ -42,6 +36,8 @@ early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT) monst_globals_init(); sys_early_init(); runtime_info_init(); + nhUse(argc); + nhUse(argv[0]); } staticfn void