Update the cross-compiling doc at the top.
Remove sys/msdos/Makefile1.cross, sys/msdos/Makefile2.cross, and
sys/msdos/msdos-cross-compile.sh as they are no longer required.
Remove occurrences of CROSSCOMPILE_HOST as the host-side of a
cross-compile can be determined from:
defined(CROSSCOMPILE) && !defined(CROSSCOMPILE_TARGET)
without the additional macro.
Disclaimer: This is a minimal recipe, just to get someone else
started if they have a desire to get a full cross-compile of
NetHack-3.7 going for the Amiga. Some NetHack code bitrot was
corrected, and it does seem able to compile the game itself
to a point. See caveats below.
- If you want to obtain the cross-compiler and tools/libs for Amiga
https://github.com/bebbo/amiga-gcc
To our knowledge, a pre-built copy isn't available, so you have to
obtain the source via git and build it on your system.
The build prerequisite packages for Ubuntu are easily obtained:
sudo apt install make wget git gcc g++ lhasa libgmp-dev \
libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev \
autoconf rsync
The build prerequisite packages for macOS are apparently easily
obtained via homebrew, but that was not tested:
brew install bash wget make lhasa gmp mpfr libmpc flex gettext \
texinfo gcc make autoconf
After installing the prerequite packages and the cross-compiler
it was a straightforward build:
git clone https://github.com/bebbo/amiga-gcc.git
cd amiga-gcc
make update
[Note that you may have to take ownership of the files in the
bebbo repo via chown before succesfully carrying out the next
steps]
make clean
make clean-prefix
date; make all -j3 >&b.log; date
The compiler pieces are installed in /opt/amiga by default which
was satisfactory for our initial attempt, but if you want you can
alter the prefix before you build if you want. That is all
spelled out on the page at: https://github.com/bebbo/amiga-gcc
The Amiga cross-compile can then be carried out by specifying
CROSS_TO_AMIGA=1 on the make command line.
For example:
make CROSS_TO_AMIGA=1 all
make CROSS_TO_AMIGA=1 package
You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build. The SDL1 pdcurses
support has not been tested.
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_AMIGA=1 all
Also note that building the amiga targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_AMIGA=1 from the make
command line.
The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.
CAVEATS: The original NetHack Amiga build steps included the source for
some utilities that were built and executed on the amiga: txt2iff and
xpm2iff as part of the NetHack build procedure on amiga. Those did not
compile out-of-the-box on the linux host. They will either have to be:
- ported to build and run on the linux or macOS cross-compile host
or
- their functionality will have to be rolled into amiga NetHack
itself and executed on the target Amiga the first time the game
is run, perhaps.
Good luck amiga aficionados, perhaps you'll be able to take this
initial effort forward and get NetHack-3.7 available on the amiga or
amiga-emulator. Let us know if you do, and we can roll changes in
if you provide them.
- If you want to obtain the djgpp cross-compiler and tools/libs for MSDOS,
which is available for linux and macOS, you can use the following script
to obtain it:
sh sys/msdos/fetch-cross-compiler.sh
That script won't install anything, it is just file fetches. It will
store the cross-compiler in subfolders of lib and the hints files are
configured to find it appropriately there.
Note: Both the fetch and the msdos cross-compile package target require
unzip and zip to be available on your host build system.
Cross-compiler bits:
https://github.com/andrewwutw/build-djgpp
and the pre-built binary for your platform from:
https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/
and a DOS-extender (for including in msdos packaging) from
http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
and pdcurses from:
https://github.com/wmcbrine/PDCurses.git
The MSDOS cross-compile can then be carried out by specifying
CROSS_TO_MSDOS=1 on the make command line.
For example:
make CROSS_TO_MSDOS=1 all
make CROSS_TO_MSDOS=1 package
You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build:
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 all
Also note that building the msdos targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_MSDOS=1 from the make
command line.
The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.
Expand the use of the sys/unix Makefiles to be used for both normal
local builds and installs, as well as cross-compiles for other
platforms/targets.
Up until now, the primary unix Makefiles have treated util/host-side
component compiles, links and target object files just the same as
the game component compiles, links, and target object files.
Unfortunately, that meant that cross-compile effort typically had
to re-invent Makefiles specific to the cross-compile, creating a
maintenance burden and deviation from the typical local unix build
and providing a daunting obstacle to those that want to establish
build for a target environment/platform.
This change distinguishes between util/host-side component builds,
links, and component builds and targets object files destined for
the game (and other target platforms) in the Makefiles.
In theory, this will ease the effort for people that want to try to
resurrect NetHack perhaps on an old platform where it is no longer
viable to build NetHack-3.7 on the platform itself using old, outdated
compile tools, possibly with an old, outdated C dialect.
Some details:
- Game-related targets in the Makefiles (as opposed to util/host-side
targets that will be executed on the host), which could be destined
for another platform in a cross-compile scenario are prefixed with
$(TARGETPFX) so that they are distinguished.
The default scenario where no cross-compiler is involved, is to
define TARGETPFX to nothing, and therefore meant to have no effect.
- Game-related compile and link commands in the Makefiles and their
associated command line flags are distinguished from util/host-side
compile and link commands in the Makefiles by using $(TARGET_CC),
$(TARGET_CFLAGS), $(TARGET_LINK), $(TARGET_LFLAGS), $(TARGET_CXX),
$(TARGET_CXXFLAGS), $(TARGET_LIBS).
Those are used in the Makefile in place of $(CC), $(CFLAGS), $(LINK),
$(LFLAGS), $(CXX), $(CXXFLAGS), $(LIBS).
The default scenario where no cross-compiler is involved, defines
the TARGET_ version of those Makefile variables to match their
typical non-TARGET_ ounterparts.
- The dependency lists in the Makefiles includes the $(TARGETPFX)
prefix for stuff that would potentially be produced from a
cross-compile build.
- It adds pregame targets and $(PREGAME) variable, so that hints files
can add some additional stuff if required for a cross-compile
scenario.
The default scenario where no cross-compiler is involved doesn't
do anything for $(PREGAME).
- It adds $(BUILDMORE) target and variable, so that hints files
can add some additional things to be built for a cross-compile
scenario.
- It adds a "package" target and $(PACKAGE) variable, so that hints files
can add steps for the target platform in a cross-compile
scenario.
The "install" target assumes local build and placement and
isn't really applicable to a cross-compile scenario where the results
really just need to be bundled up for transport to the target platform.
- Also, this adds a pair of include files that can be updated with some
cross-compile recipes as they evolve. They are named "cross-pre.2020"
(for stuff to be included in the PRE section) and "cross-post.2020"
for stuff to be included in the POST section via sys/unix/setup.sh.
Those are included in sys/unix/hints/linux.2020 and
sys/unix/hints/macOS.2020 hints files.
Replace the blank placeholder icon with individual placeholders
for Stone, Slime, Strngl, Deaf, Lev, Fly, and Ride. They're just
40x40 tiles showing solid color (different for each) holding white
block letters spelling the condition. For the first four of those,
the text runs from upper-left to lower-right, for Lev and Fly the
text runs from lower-left towards upper-right, and for Ride it's
horizontal. Not particularly exciting but better than blank. We
still need real artwork to make them be similar to the older
conditions.
Also moves the two petmarks and the pilemark from qt_xpms.h to
qt_map.cpp. The marks and the assorted status icons are all
static arrays, and including that header in two source files
meant that they were all duplicated unless the compiler or linker
was smart enough to discard the unused ones.
Avoid use of GNU make's 'override' feature by requiring
'make CCFLAGS=-O' to replace -g from the make command line instead
of 'make CFLAGS=-O'. Note the extra 'C' in the spelling.
Revert the previous umpteen MORECFLAGS+= back to normal CFLAGS+=.
A recent change was intended to allow specifying
make CFLAGS=-O
on the command line to override our default of -g, but it didn't
work as intended. foo=bar and foo+=bar don't work if foo has
been given a value on the command line. The first was expected
behavior but the second wasn't, at least for me. GNU make allows
'override foo+=bar' to cope with that. (We're already implicitly
requiring GNU make for the linux and OSX hints.)
../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
680 | snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
| ^~ ~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
680 | snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
| ^~ ~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Playground setup: Qt does not use external files pet_mark.xbm and
pilemark.xbm, it has pixmaps for those compiled in via qt_xpms.h.
Presumably because the pet mark heart has two sizes there.
- should work on linux or MacOS to build an msdos zipfile distribution
- no longer requires env variables be set ahead of it because it will set some
defaults within
- you must have zip and unzip on your system though
- you have to "make fetch-lua" first if you haven't already done that
- script takes care of obtaining the djgpp-cross-compiler etc, then
uses it to build msdos NetHack
- to clean and rebuild from scratch:
make -f sys/msdos/Makefile1.cross clean
Also updates the travis build to Ubuntu focal because of an
ar libfl.so.2 shared library load error on xenial that was
easier to just get away from by moving to focal.
Allow sharing of common code between different hints files
through use of: #-INCLUDE
new folder created: sys/unix/hints/include
new hints include files:
sys/unix/hints/include/multiw-1.2020
sys/unix/hints/include/multiw-2.2020
structure the early parts of sys/unix/hints/linux.2020 and
sys/unix/hints/macOS.2020 consistently, and utilize #-INCLUDE multiw-1.2020
and #-INCLUDE multiw-2.2020 in them. That will allow the Makefile lines
that they contain to be maintained in a single place.
Without that:
botl.c: In function ‘status_hilite2str’:
botl.c:3236:24: warning: ‘/’ directive writing 1 byte into a region of size between 0 and 255 [-Wformat-overflow=]
3236 | Sprintf(buf, "%s/%s/%s", initblstats[hl->fld].fldname, behavebuf, clrbuf);
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 3 or more bytes (assuming 513) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘status_hilite_linestr_gather_conditions’:
botl.c:3134:48: warning: ‘%s’ directive writing up to 255 bytes into a region of size 245 [-Wformat-overflow=]
3134 | Sprintf(condbuf, "condition/%s/%s",
| ^~
3135 | conditionbitmask2str(cond_maps[i].bm), clrbuf);
| ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 12 or more bytes (assuming 267) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘do_statusline2’:
botl.c:229:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
229 | Sprintf(newbot2, "%s %s %s %s %s", hlth, cond, dloc, expr, tmmv);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:227:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
227 | Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, cond, expr, tmmv);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:225:37: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
225 | Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, expr, cond, tmmv);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c:219:33: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 0 and 254 [-Wformat-overflow=]
219 | Sprintf(newbot2, "%s %s %s %s %s", dloc, hlth, expr, tmmv, cond);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 640 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
botl.c: In function ‘status_hilite_menu_add’:
botl.c:3726:38: warning: ‘ or ’ directive writing 4 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
3726 | Sprintf(obuf, "%s or %s",
| ^~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from botl.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 163 bytes into a destination of size 80
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmd.c: In function ‘extcmd_via_menu’:
cmd.c:668:44: warning: ‘%s’ directive writing up to 127 bytes into a region of size 110 [-Wformat-overflow=]
668 | Sprintf(prompt, "Extended Command: %s", cbuf);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from cmd.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 19 and 146 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmd.c: In function ‘paranoid_query’:
cmd.c:4488:30: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 113 and 128 [-Wformat-overflow=]
4488 | Sprintf(qbuf, "%s%s %s", promptprefix, pbuf, responsetype);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from cmd.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 282 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c: In function ‘getpos_menu’:
do_name.c:612:37: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
612 | Sprintf(fullbuf, "%s%s%s", firstmatch,
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 1 or more bytes (assuming 257) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c: In function ‘getpos’:
do_name.c:205:31: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
205 | Sprintf(sbuf, "Type a %s when you are at the right place.", kbuf);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 41 and 296 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_name.c:205:31: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
205 | Sprintf(sbuf, "Type a %s when you are at the right place.", kbuf);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from do_name.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 41 and 296 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
do_wear.c: In function ‘armor_or_accessory_off’:
do_wear.c:1510:52: warning: ‘%s’ directive writing up to 127 bytes into a region of size 103 [-Wformat-overflow=]
1510 | Sprintf(why, " without taking off your %s first", what);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from do_wear.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 32 and 159 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c: In function ‘print_dungeon’:
dungeon.c:2156:27: warning: ‘%s’ directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
2156 | Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 1427 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:2153:27: warning: ‘%s’ directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
2153 | Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
| ^~
dungeon.c:2153:26: note: directive argument in the range [-2147483647, 2147483646]
2153 | Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
| ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 10 or more bytes (assuming 1427) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c: In function ‘print_mapseen’:
dungeon.c:3191:33: warning: ‘%s’ directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
3191 | Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
| ^~ ~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 37 and 292 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:3352:35: warning: ‘%s’ directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
3352 | Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 18 and 273 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dungeon.c:3403:40: warning: ‘%s’ directive writing up to 255 bytes into a region of size 242 [-Wformat-overflow=]
3403 | Sprintf(buf, "%s%syou, %s%c", PREFIX, TAB, tmpbuf,
| ^~ ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from dungeon.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 16 and 271 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c: In function ‘edibility_prompts’:
eat.c:2359:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2359 | Sprintf(buf, "%s like %s could be tainted! %s", foodsmell, it_or_they,
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 27 and 536 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2385:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2385 | Sprintf(buf, "%s like %s might be poisonous! %s", foodsmell,
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 29 and 538 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2394:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2394 | Sprintf(buf, "%s like %s might have been poisoned. %s", foodsmell,
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 35 and 544 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2400:25: warning: ‘ unhealthy. ’ directive writing 13 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2400 | Sprintf(buf, "%s unhealthy. %s", foodsmell, eat_it_anyway);
| ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 14 and 396 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2407:25: warning: ‘ rather acidic. ’ directive writing 17 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2407 | Sprintf(buf, "%s rather acidic. %s", foodsmell, eat_it_anyway);
| ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 18 and 400 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2415:25: warning: ‘ disgusting to you right now...’ directive writing 31 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2415 | Sprintf(buf, "%s disgusting to you right now. %s", foodsmell,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 32 and 414 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2430:25: warning: ‘ foul and unfamiliar to you...’ directive writing 30 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2430 | Sprintf(buf, "%s foul and unfamiliar to you. %s", foodsmell,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 31 and 413 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2450:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2450 | Sprintf(buf, "%s like %s could be tainted! %s",
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 27 and 536 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2441:25: warning: ‘ unfamiliar to you. ’ directive writing 21 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2441 | Sprintf(buf, "%s unfamiliar to you. %s", foodsmell, eat_it_anyway);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 22 and 404 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2376:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2376 | Sprintf(buf, "%s like %s could be rotten! %s", foodsmell, it_or_they,
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 25 and 534 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eat.c:2367:25: warning: ‘ like ’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
2367 | Sprintf(buf, "%s like %s could be something very dangerous! %s",
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from eat.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 44 and 553 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
explode.c: In function ‘explode’:
explode.c:539:69: warning: ‘%s’ directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
539 | Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from explode.c:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 21 or more bytes (assuming 276) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hacklib.c: In function ‘yyyymmddhhmmss’:
hacklib.c:1089:28: warning: ‘%02d’ directive writing between 2 and 11 bytes into a region of size between 4 and 11 [-Wformat-overflow=]
1089 | Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
| ^~~~
hacklib.c:1089:22: note: directive argument in the range [-2147483647, 2147483647]
1089 | Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from hacklib.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 15 and 67 bytes into a destination of size 15
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘status_enlightenment’:
insight.c:1208:40: warning: ‘%s’ directive writing up to 255 bytes into a region of size 127 [-Wformat-overflow=]
1208 | Sprintf(sfx, " %s", buf), buf[0] = '\0';
| ^~ ~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘list_vanquished’:
insight.c:2464:39: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
2464 | Sprintf(buftoo, "%*s%s", pfx, "", buf);
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 1 and 261 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘background_enlightenment’:
insight.c:326:27: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 253 and 256 [-Wformat-overflow=]
326 | Sprintf(buf, "%s%s%s%s form", !final ? "currently " : "",
| ^~
327 | altphrasing ? just_an(anbuf, tmpbuf) : "in ",
328 | tmpbuf, uasmon->mname);
| ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 6 or more bytes (assuming 264) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:326:27: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 243 and 246 [-Wformat-overflow=]
326 | Sprintf(buf, "%s%s%s%s form", !final ? "currently " : "",
| ^~
327 | altphrasing ? just_an(anbuf, tmpbuf) : "in ",
328 | tmpbuf, uasmon->mname);
| ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 16 or more bytes (assuming 274) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:444:33: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 121 and 248 [-Wformat-overflow=]
444 | Sprintf(buf, "in %s, on %s", dgnbuf, tmpbuf);
| ^~ ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 9 and 391 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c:423:48: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 223 and 233 [-Wformat-overflow=]
423 | Sprintf(buf, "in the endgame, on the %s%s",
| ^~
424 | !strncmp(tmpbuf, "Plane", 5) ? "Elemental " : "", tmpbuf);
| ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 289 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
insight.c: In function ‘enlightenment’:
insight.c:245:21: warning: ‘ the ’ directive writing 5 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
245 | Sprintf(buf, "%s the %s's attributes:", tmpbuf,
| ^~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from insight.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 20 or more bytes (assuming 275) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c: In function ‘hitmm’:
mhitm.c:591:37: warning: ‘ squeezes’ directive writing 9 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
591 | Sprintf(buf, "%s squeezes", magr_name);
| ^~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 265 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:578:33: warning: ‘ stings’ directive writing 7 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
578 | Sprintf(buf, "%s stings", magr_name);
| ^~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 8 and 263 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:584:33: warning: ‘ touches’ directive writing 8 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
584 | Sprintf(buf, "%s touches", magr_name);
| ^~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 9 and 264 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:581:33: warning: ‘ butts’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
581 | Sprintf(buf, "%s butts", magr_name);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 262 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:575:33: warning: ‘ bites’ directive writing 6 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
575 | Sprintf(buf, "%s bites", magr_name);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 7 and 262 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mhitm.c:597:37: warning: ‘ hits’ directive writing 5 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
597 | Sprintf(buf, "%s hits", magr_name);
| ^~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from mhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 6 and 261 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
options.c: In function ‘option_help’:
options.c:8035:28: warning: ‘ - ’ directive writing 3 bytes into a region of size between 1 and 236 [-Wformat-overflow=]
8035 | Sprintf(buf, "%-20s - %s%c", buf2, allopt[i].descr,
| ^~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from options.c:14:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 25 or more bytes (assuming 260) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pager.c: In function ‘do_screen_description’:
pager.c:1189:38: warning: ‘%s’ directive writing up to 255 bytes into a region of size 254 [-Wformat-overflow=]
1187 | *firstmatch = look_buf;
| ~~~~~~~~
1188 | if (*(*firstmatch)) {
1189 | Sprintf(temp_buf, " (%s)", *firstmatch);
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from pager.c:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 4 and 259 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pager.c:1195:44: warning: ‘%s’ directive writing up to 255 bytes into a region of size 248 [-Wformat-overflow=]
1195 | Sprintf(temp_buf, " [seen: %s]", monbuf);
| ^~ ~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from pager.c:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 265 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c: In function ‘dodip’:
potion.c:1949:26: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
1949 | Sprintf(qbuf, "%s%s into the %s?", Dip_,
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 16 or more bytes (assuming 143) into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c:1939:26: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
1939 | Sprintf(qbuf, "%s%s into the fountain?", Dip_,
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 151 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c:1969:24: warning: ‘%s’ directive writing up to 127 bytes into a region of size 124 [-Wformat-overflow=]
1969 | Sprintf(qbuf, "dip %s into", flags.verbose ? obuf : shortestname);
| ^~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 10 and 137 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
potion.c: In function ‘potionhit’:
potion.c:1424:41: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
1424 | Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from potion.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 257) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spell.c: In function ‘getspell’:
spell.c:706:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size 109 [-Wformat-overflow=]
706 | Sprintf(qbuf, "Cast which spell? [%s *?]", lets);
| ^~ ~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from spell.c:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 24 and 279 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
topten.c: In function ‘outentry’:
topten.c:1060:32: warning: ‘%s’ directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
1060 | Sprintf(linebuf, "%15s %s", "", linebuf3);
| ^~ ~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from topten.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 17 and 272 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
trap.c: In function ‘untrap’:
trap.c:4462:58: warning: ‘%s’ directive writing up to 255 bytes into a region of size 88 [-Wformat-overflow=]
4462 | qbuf, "There %s and %s here. %s %s?",
| ^~
......
4465 | (ttmp->ttyp == WEB) ? "Remove" : "Disarm", the_trap);
| ~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from trap.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 42 or more bytes (assuming 297) into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uhitm.c: In function ‘hmon_hitmon’:
uhitm.c:1316:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 244 and 251 [-Wformat-overflow=]
1316 | Sprintf(silverobjbuf, "Your %s%s %s",
| ^~
1317 | strstri(saved_oname, "silver") ? "" : "silver ",
1318 | saved_oname, vtense(saved_oname, "sear"));
| ~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from uhitm.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 7 or more bytes (assuming 269) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c: In function ‘enhance_weapon_skill’:
weapon.c:1271:47: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 249 and 253 [-Wformat-overflow=]
1271 | Sprintf(buf, " %s%s\t[%s]", prefix, P_NAME(i),
| ^~
1272 | sklnambuf);
| ~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 5 or more bytes (assuming 264) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1268:49: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 248 and 252 [-Wformat-overflow=]
1268 | Sprintf(buf, " %s %-*s [%s]", prefix, longest,
| ^~
1269 | P_NAME(i), sklnambuf);
| ~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 6 or more bytes (assuming 265) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1263:46: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 250 and 254 [-Wformat-overflow=]
1263 | Sprintf(buf, " %s%s\t%s\t%5d(%4d)", prefix, P_NAME(i),
| ^~
1264 | sklnambuf, P_ADVANCE(i),
| ~~~~~~~~~
weapon.c:1263:38: note: directive argument in the range [0, 65535]
1263 | Sprintf(buf, " %s%s\t%s\t%5d(%4d)", prefix, P_NAME(i),
| ^~~~~~~~~~~~~~~~~~~~~
weapon.c:1263:38: note: directive argument in the range [-325120, 327680]
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 15 or more bytes (assuming 277) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1259:47: warning: ‘%-12s’ directive writing between 12 and 255 bytes into a region of size between 250 and 254 [-Wformat-overflow=]
1259 | Sprintf(buf, " %s%-*s %-12s %5d(%4d)", prefix,
| ^~~~~
1260 | longest, P_NAME(i), sklnambuf, P_ADVANCE(i),
| ~~~~~~~~~
weapon.c:1259:38: note: directive argument in the range [0, 65535]
1259 | Sprintf(buf, " %s%-*s %-12s %5d(%4d)", prefix,
| ^~~~~~~~~~~~~~~~~~~~~~~~
weapon.c:1259:38: note: directive argument in the range [-325120, 327680]
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from weapon.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 27 or more bytes (assuming 277) into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../win/curses/cursinit.c: In function ‘curses_choose_character’:
../win/curses/cursinit.c:454:26: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
454 | sprintf(choice, "%s%c", tmpchoice, '\033');
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/curses.h:192,
from ../win/curses/cursinit.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 129 bytes into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../win/X11/winX.c: In function ‘X11_init_nhwindows’:
../win/X11/winX.c:1509:12: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result]
1509 | (void) seteuid(getuid());
| ^~~~~~~~~~~~~~~~~
../win/X11/winX.c:1570:12: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result]
1570 | (void) seteuid(savuid);
| ^~~~~~~~~~~~~~~
../win/tty/wintty.c: In function ‘tty_player_selection’:
../win/tty/wintty.c:964:30: warning: ‘%s’ directive writing up to 127 bytes into a region of size between 95 and 126 [-Wformat-overflow=]
964 | Sprintf(pbuf, "%s, %s%s %s %s", g.plname, aligns[ALGN].adj, plbuf,
| ^~ ~~~~~
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from ../win/tty/wintty.c:15:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output 5 or more bytes (assuming 163) into a destination of size 128
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
version.c: In function ‘early_version_info’:
version.c:263:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
263 | Sprintf(buf2, "%s\n", buf);
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from version.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
version.c:263:24: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
263 | Sprintf(buf2, "%s\n", buf);
| ^
In file included from /usr/include/stdio.h:867,
from ../include/global.h:9,
from ../include/config.h:608,
from ../include/hack.h:10,
from version.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 256
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
any subset of those.
- For x11 support, you'll need to obtain and install x11 development libraries.
For example, on Ubuntu 20.04 (as of August 2020):
sudo apt-get install libx11-dev
sudo apt-get install libmotif-dev
sudo apt-get install libxaw7-dev
sudo apt install xfonts-utils
(That last one is for bdftopcf and mkfontdir utils)
- For Qt support, you'll need to obtain and install Qt.
For example, on Ubuntu 20.04 (as of August 2020):
sudo apt-get install qtbase5-dev
sudo apt-get install qtmultimedia5-dev
Another odd note about Qt on Linux is that if you find you are getting
the following error trying to run NetHack after you build it:
"error while loading shared libraries: libQt5Core.so.5:
cannot open shared object file: No such file or directory"
you may have to fix that (one-time only) by the following command:
sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
- For curses support, you may need to obtain and install the
ncurses development libraries if they aren't already installed
with your distribution. They seem to be there already with Ubuntu 20.04, but
for example, if you needed to install ncurses:
sudo apt-get install libncurses-dev
- tty support shouldn't require any prerequisite additional packages.
---
Assuming you have the prerequisite packages mentioned above, you can
specify, right on the make command line, which window ports (or interfaces)
to include in your build. Doing it via the make command line means that you
don't have to edit the Makefile.
The make command line example below will build one binary that has
support for tty, curses, x11, and Qt. You can select between them via
your .nethackrc file (OPTIONS=windowtype:curses, OPTIONS=windowtype:tty,
OPTIONS=windowtype:x11, or OPTIONS=windowtype:Qt).
make WANT_WIN_QT=1 WANT_WIN_X11=1 WANT_WIN_CURSES=1 WANT_WIN_TTY=1 install
Started out removing some trailing spaces and ended up making various
substantive changes.
Don't include tty by default since the sample make command shows how
to enable it and there isn't any easy way to disable it other than
not requesting it to begin with. (Due to using defined/not-defined
rather than values in the 'if' directives, WANT_WIN_TTY=0 is the same
as WANT_WIN_TTY=1 rather than it's inverse.)
That resulted in all the interfaces starting commented out, so add
some make code to make sure that at least one is enabled. If none,
it silently enables tty.
The sequence
|CXX=compilerA
|LINK=$(CXX)
|#CXX=compilerB
wouldn't work if 'make' substitutes immediately (I can't recall
offhand whether it does) and the first CXX was commented out in
order to uncomment the second one. The default CXX value would be
used instead of the #CXX=foo one even if it was uncommented. Just
move LINK= after it.
Build logic has been tested. Final install and packaging for
distribution have not (but weren't touched so shouldn't be affected).
Testing some hints revisions resulted in some bafflement which
turned out to be caused by 'make spotless' in the dat subdirectory
not removing 'options'. It wasn't removing several other generated
files either. That used to work but got clobbered when the lua
special levels replaced levcomp and dgncomp.
Assuming you have the prerequisite packages, You can specify the
window ports to include on the make command line:
make WANT_WIN_QT=1 WANT_WIN_X11=1 WANT_WIN_CURSES=1 WANT_WIN_TTY=1 all
Prequisites for window ports beyond tty:
(some sample homebrew commands to obtain them shown but that is not the
only way):
xquartz for x11 support
brew install xquartz
Qt for Qt support
brew install Qt
Using hints/macosx10.10-qt,
| make QTDIR={path} WANT_WIN_X11=1 USE_XPM=1
now builds a combined tty+Qt+X11 binary. Linking the X11 code
works a lot better when the Makefile tells the linker where the
X11 libraries are....
This reconciles some of the differences between macosx10.10 and
macosx10.10-qt but there are still lots more (including lack of
WANT_WIN_CURSES in the latter). And now 10.10 has differences
with the half dozen or so other macosx10.* hints.
After installing qt511-qtbase and qt511-qtmultimedia from macports
on my OSX 10.11 system (there is a qt513 but it requires OSX 10.12),
I can build the Qt interface with hints/macosx10.10-qt by overriding
QTDIR. It doesn't actually need the extra CFLAGS, and without those
I wonder whether the multimedia package is needed either, but I've
left them in. I have changed them to not be passed to the C sources
though, just the C++ ones.
I haven't tried combining with X11 or adding curses.
macosx10.10-qt was derived from an out of date version of
macosx10.10. This tries to make combined X11+Qt behave sanely but
I have no way of testing it.
It appears to require homebrew, at least that's what the construct
$(shell brew ...) to set up QTDIR suggests. That seems iffy and
should at least be documented.
It includes tty along with Qt but lacks support for including the
curses interface so definitely needs more updating.