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.
This commit is contained in:
+3
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user