fix some libnh wasm build issues
emcc: error: linker setting ignored during compilation: 'ASSERTIONS' [-Wunused-command-line-argument] [-Werror]
make[1]: *** [Makefile:1306: ../targets/wasm/allmain.o] Error 1
wasm-ld: error: ../targets/wasm/version.o: undefined symbol: nomakedefs
These ones look like actual NetHack issues that this particular compile is catching due to
default -Wunused-but-set-variable.
In the interest of time today, I mostly resorted to using nhUse() on them for now, but a
follow-up by someone might be useful.
options.c:6069:13: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
boolean ret = FALSE;
^
restore.c:903:9: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
int len = 0;
^
uhitm.c:4539:43: error: variable 'nsum' set but not used [-Werror,-Wunused-but-set-variable]
int i, tmp, armorpenalty, sum[NATTK], nsum = MM_MISS,
^
This commit is contained in:
@@ -6074,6 +6074,8 @@ parsebindings(char *bindings)
|
||||
ret |= parsebindings(bind);
|
||||
}
|
||||
|
||||
nhUse(ret);
|
||||
|
||||
/* parse a single binding: first split around : */
|
||||
if (! (bind = index(bindings, ':')))
|
||||
return FALSE; /* it's not a binding */
|
||||
|
||||
@@ -927,6 +927,7 @@ rest_stairs(NHFILE* nhfp)
|
||||
if (newst)
|
||||
newst->u_traversed = stway.u_traversed;
|
||||
}
|
||||
nhUse(len); /* unclear why this variable exists though */
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -4541,6 +4541,13 @@ hmonas(struct monst *mon)
|
||||
int dieroll, multi_claw = 0;
|
||||
boolean monster_survived;
|
||||
|
||||
/* FIXME: One compiler was getting a fatal
|
||||
variable nsum set but not used [-Werror,-Wunused-but-set-variable]
|
||||
For now, I'm working around it with nhUse() but it should be
|
||||
investigated when someone has the time.
|
||||
*/
|
||||
nhUse(nsum);
|
||||
|
||||
/* not used here but umpteen mhitm_ad_xxxx() need this */
|
||||
g.vis = (canseemon(mon) || distu(mon->mx, mon->my) <= 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user