xNetHack
xNetHack copied to clipboard
Needs old compat code stripped out
The file hacklib.c currently has a lot of code guarded with defined(BSD) that makes various functions use long for time stamps instead of time_t. However, this hasn't been the case for decades. Please fix the code by discarding the BSD special code path.
This was first noticed in by a compiler warning:
hacklib.c:1146:24: warning: incompatible pointer types passing 'long *' to parameter of type 'const time_t *' (aka 'const long long *') [-Wincompatible-pointer-types]
lt = localtime((long *) (&date));
^~~~~~~~~~~~~~~~
../include/system.h:541:38: note: passing argument to parameter here
E struct tm *localtime(const time_t *);
^
There are probably more issues coming from this.
This should probably be reported on the main NetHack/NetHack repo (or by email to [email protected]) since it's not specific to xNetHack. It'd be more appropriately fixed upstream I think.
@entrez I have been instructed by aosdict on the IRC channel to file a bug report for this here. I am not interested in chasing after this any more, so feel free to report this to the Nethack dev team yourself.
Oh, well, @copperwater knows better than I do what is inherited or changed from vanilla NetHack, so if he says it should go here I won't meddle any further. :)
When I said to submit a PR for it, I had assumed this issue only existed in NetHack code. If it exists upstream, it should indeed be reported to the DevTeam and fixed there. If you want, I can copy paste your first post as an issue there.
@copperwater It would be nice if you could do that. I have never interacted with the upstream dev team before.
Should be fixed by https://github.com/NetHack/NetHack/commit/e815498f074f804dcc6c4f789ccdb7cec80b0e56, when xNetHack next merges it. Up to you @clausecker if you want to close this or wait until that vanilla merge happens (probably version 8.0 release).
Now that vanilla has been merged, this should be taken care of. Please reopen if that's not the case somehow.