Commit Graph

10954 Commits

Author SHA1 Message Date
PatR
3a07880684 paper doll inventory display vs hallucination
During hallucination, actions which triggered update of persistent
inventory made Qt's display of map tiles for equipped objects have
those tiles switch randomly, but ordinary move-by-move fluctations
applied to floor objects left them alone.

Initially I took out hallucination of inventory items altogether,
but ended up putting that back and changing the floor hallucination
to affect Qt's paper doll too.  The display.h change isn't needed
but I've left it in.
2020-08-17 14:48:00 -07:00
PatR
9a866d3601 Qt "Paper Doll" inventory
Enhance the "Qt Settings" dialog box to provide control over the
paper doll subset of inventory displayed between the message and
status windows (above the map).  A ton of flailing about for a
fairly small but useful change in functionality.

Old dialog (no title):
| [ ] Zoomed            -- check box
| "Width:"  [      ]    -- number entry spinner
| "Height:" [      ]    -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [      Dismiss      ] -- button

New dialog:
|     "Qt NetHack Settings"
|
| "Map:"    [ ] "Zoomed"        -- check box
|           "Tile Width"   [  ] -- number entry spinner
|           "Tile Height"  [  ] -- ditto
| "Invent:" [ ] "Shown"         -- check box
|           "Doll Width"   [  ] -- number entry spinner
|           "Doll Height"  [  ] -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [          Dismiss          ] -- button

The inventory subset can now be suppressed.  When shown (the default),
its size can be set independently of the map tiles' size.  I've set
the default to be 32x32 tiles instead of 16x16 used for the map.

The settings are saved and restored automatically by Qt, and persist
not just across save/restore cycles but into new games.  (That's not
a change, just a reminder.)
2020-08-15 19:48:33 -07:00
nhmall
89fbe2162e remove duplicate line in .travis.yml 2020-08-15 16:52:19 -04:00
nhmall
1879f21176 adjust travis-ci builds
add builds that tests tty, curses, X11, and Qt5 on
all of the following:
linux-xenial, linux-bionic, linux-focal

Also still tests "nocommon" on earlier gcc versions.
Add a focal with gcc9 build to test that compiler version.

Here are the test builds:
linux-xenial-gcc-win-all
linux-bionic-gcc-win-all
linux-focal-clang-win-all
linux-xenial-gcc-nocommon
linux-focal-gcc9-win-all
linux-xenial-gcc-minimal
windows-visualstudio
windows-mingw
msdos-linux-focal-djgpp-crosscompile
2020-08-15 16:43:59 -04:00
nhmall
14d55c5bdb make sys/msdos/msdos-cross-compile.sh build msdos NetHack entirely
- 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
2020-08-14 18:23:31 -04:00
nhmall
83f8da2a17 msdos cross-compile djggp build now with gcc 10
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.
2020-08-14 17:25:05 -04:00
PatR
aaf1d4d381 'O' couldn't change 'symset'
The revised options processing from however long ago broke using
'O' to change 'symset'.  ('roguesymset' worked ok.)  Picking it
in the main 'O' menu behaved as it nothing had been picked.  The
symset-specific submenu wasn't offered to the player because a
two-line block of code was omitted.

It seems amazing that no one has noticed in all this time.
2020-08-13 15:24:24 -07:00
nhmall
3e9eb0d784 another typo 2020-08-13 13:48:33 -04:00
nhmall
39b30acb56 wording bit 2020-08-13 13:42:40 -04:00
nhmall
3592604b9c minor typo bit in NewInstall.unx
missing closing bracket ')' and wording change
2020-08-13 13:39:17 -04:00
nhw_cron
cbf61af5b0 This is cron-daily v1-Jan-20-2020. files updated: Files 2020-08-13 13:37:22 -04:00
nhmall
59fb03f004 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-08-13 13:35:37 -04:00
nhmall
c67ef6acf8 update bottom of NewInstall.unx document with WANT_WIN_ build steps 2020-08-13 13:34:18 -04:00
nhmall
410b46678b comment bit
name had evolved but the comment had not been updated
2020-08-13 11:57:14 -04:00
nhmall
674021428d macosx.h Info.plist bit 2020-08-13 11:35:26 -04:00
nhmall
bdbf8f19cc update some hints mechanics for 2020
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.
2020-08-13 11:34:23 -04:00
PatR
cee29d3338 more Qt formatting 2020-08-13 02:00:11 -07:00
PatR
58d208ee8f minor Qt reformatting 2020-08-13 01:45:06 -07:00
PatR
0645f5483d Qt header usage
Move the nine #undef's common to all qt_*.cpp sources into qt_pre.h.

Make "hack.h" usage consistent; always enclose withing 'extern "C {'
and '}' even though only some of the sources care.
2020-08-12 17:01:03 -07:00
PatR
0f65db801c tile2x11.h comment 2020-08-12 16:15:28 -07:00
PatR
4590bf1f01 disclosing inventory
The end of game disclosure for inventory was passing want_reply==True
to the inventory display routine.  I don't know why because you can't
select anything.  This resulted in Qt disclosure showing inventory
with the [Ok] button disabled and blank boxes instead of object
glyphs beside the inv letters.  Changing to want_reply==False fixes
both aspects of that.

It has no apparent effect on tty or curses; on X11 (where [Ok] was
already enabled) it disables the [Search] button, a plus.  I don't
know whether it might mess up final disclosure for inventory on
WindowsGUI.  Or whether any interface which uses perm_invent window
for final inventory disclosure (if there are any) will be adversely
affected.
2020-08-11 14:55:43 -07:00
nhmall
0500aae0c0 another linux.2020 tweak
Leave CC alone; we've already determined whether it invoked gcc or clang
2020-08-10 21:39:00 -04:00
nhmall
fbf113ccf1 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-08-10 21:28:59 -04:00
nhmall
ed46d5db08 detect the compiler available
test if CC invokes clang. If not, then assume it is gcc.
2020-08-10 21:27:05 -04:00
PatR
8cc7580474 Qt info->annotate
The core is mapping #annotate to ^N, which has no effect when
number_pad is Off.  The Qt menu setup saw it as the way to run
that command, which will only work when number_pad is On.  This
fixes the menu and didn't break the large subset of other menu
commands I've tried, but I haven't gotten through half of them yet.
2020-08-10 18:11:12 -07:00
PatR
7310084692 Qt menu tweak
An earlier tweak worked to prevent unnecessary line wrapping
for ^X output in a menu, but #enhance and '+' both had problems
with their last column.  This seems to work better but is still
based on thrashing about rather than knowledge of how things are
supposed to operate.
2020-08-10 16:39:30 -07:00
PatR
7f85408962 Qt paper doll inventory
In case you haven't seen it, the Qt screen layout is (a bigger
instance of):
+--------------------+------+--------------------------------+
| messages           |invent| status                         |
|                    |subset|                                |
|                    |      |                                |
|                    |      |                                |
+------------------------------------------------------------+
| map                                                        |
|                                                            |
 ...
|                                                            |
+------------------------------------------------------------+
where some status fields include an icon and the inventory subset is
a miniature map showing a paper doll-style display of object tiles
for worn and wielded items.  The two separating lines in the top half
can be dragged to resize the three windows there.  The default message
window width to too small to see full text of some messages but can
be scrolled left and right.  The window for the equipped subset of
inventory is unconditionally present; 'perm_invent' is a no-op.

Paper doll inventory layout (view with fixed-width font...):
Old         New         two-hand    dual-wield
  x H b       x H b       x H b       . H b
  S " w       S " w       W " W       X " w
  G C G       G C q       G C q       G C q
  = A =       = A =       = A =       = A =
  . U .       l U L       l U L       l U L
  . F .       . F .       . F .       . F .
Legend:
 '.' = blank, b = blindfold, '"' = amulet, '=' = left and right rings,
 w/W = primary weapon, x/X = alternate/secondary weapon, q = quiver,
 H = helmet, S = shield, G = gloves, C = cloak, A = suit, U = shirt,
 F = boots, l = leash, L = active light source (lamp/candle/Sunsword).
Slots which don't have something equipped are shown blank.

'q' was missing; 'G' used to be shown on both sides.  'l' and 'L' are
new; for either, it picks the first one in inventory that's in active
use.  The 'S' and 'x' slots vary depending upon weapon situation
since wearing a shield, wielding a two-handed weapon, and engaging in
two-weapon combat are all mutually exclusive.
2020-08-10 15:25:56 -07:00
PatR
75fa283fb6 leash use vs perm_invent
Noticed while working on Qt's version of persistent inventory
window (paper doll-style display of equipment in use), leashing
or unleashing a pet wasn't updating persistent inventory.  Leash
descriptions format differently when in use so immediate update
is warranted.
2020-08-10 13:20:24 -07:00
nhmall
8dca9b4f8a add compiler detection so warnings adjusted appropriately 2020-08-10 11:13:16 -04:00
PatR
264cbed2cc Qt menu sanity
The Qt menu entries which were executing nethack's help command
(the '?' menu) were doing so because their command keystroke was
a meta-character and such characters are being converted to '?'
to indicate an error in conversion to Latin1 character set.  The
old Qt3 code didn't perform any such conversion.

This fix feels fragile because there are two different places
deciding how to disambiguate partial extended commands (the code
for Qt's '#' handling and a new routine in the core).  Qt menus
now send '#' and enough letters to satisfy '#' handling for any
command which uses M-c or has no regular keystroke nor M-c one.
(If it were to send the full extended command name, the letters
after the unambiguous prefix would be left in the input queue to
be processed as subsequent commands.)

There is a fundamental problem that this doesn't address:  if
the player uses BIND directives in the run-time config file, the
Qt menu bindings will break unless the BINDs are all done before
selecting windowtype.  Qt's menu bindings translate a click on
a menu entry into the keystroke used to invoke the corresponding
command, so using BIND to change that after the menus are set up
will result in the wrong commands being executed.
2020-08-10 07:24:16 -07:00
nhmall
ef9caca4da distinguish compiler version before adding new -Wno option 2020-08-10 10:03:12 -04:00
nhmall
084d1a8773 Use the same compiler for Lua as specified for NetHack
It tried to use gcc for Lua when no gcc was available and failed.
2020-08-09 23:54:15 -04:00
nhw_cron
a6debd4755 This is cron-daily v1-Jan-20-2020. files updated: Files 2020-08-09 23:50:41 -04:00
nhmall
6087891d4b add -Wno-format-overflow to build under sys/unix/hints/linux.2020
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 ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-08-09 23:33:55 -04:00
nhmall
90a418a80a This sys/unix/hints/linux.2020 file can support tty, curses, x11, and Qt in the same binary, or
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
2020-08-09 19:02:50 -04:00
PatR
a87a83fc83 Qt menu fixes: mainly Quit
Changes affecting everybody (using Qt):  rename game->Save to
game->Save-and-exit and game->Quit to game->Quit-without-saving.

OSX-specific changes:  add separate nethack->Quit and change
game->Quit-without-saving to game->_Quit-without-saving to prevent
that from being hijacked for the nethack menu.  nethack->Quit menu
entry works.  Command+Q is a keyboard shortcut for it.  They bring
up a menu with choices of "Quit without saving" and "Cancel and
return to game".  It's not the same as the handler for the window
Close button, which used to offer "Save" or "Cancel" (with the
latter triggering an infinite loop) but now offers "Save and exit"
or "Quit without saving".  They don't share any code.  The
game->_Quit-without-saving entry doesn't work; it runs nethack's '?'
command like a bunch of other broken menu entries.  If it did work,
it would give nethack's "Really quit?" prompt and proceed from there.
The "Quit without saving" response for nethack->Quit confirmation
bypasses that and just quits.

Also OSX, add a second 'about' entry.  The first one is hijacked and
added to the nethack menu, the second is help->_About_Qt_NetHack_
and avoids hijacking.  Both nethack->About and help->_About_ bring
up the same dialog box showing version and assorted other info.

A lot of flailing about with for relatively small amount of progress.
2020-08-09 14:55:05 -07:00
PatR
251fd5c0f7 X11 icons
Update the two X11 bitmaps which have embedded version numbers,
nh32icon and nh56icon.  ("3.6" -> "3.7"; the third, nh72icon,
doesn't show version.)
2020-08-09 12:36:13 -07:00
PatR
07510fc833 Qt Confusion icon
In the Qt status panel the six characteristics and the older
status conditions all have icons (similar to map tiles) drawn
above their values.  (The 3.6 era conditions that I added all
have blank icons and are in need of artwork.  3.7 conditions
aren't implemented.)

Int, Stun, and Conf all feature a brain oriented towards the
player's right shoulder.  The intelligence one is just a bare
brain, the stunned one features a black cloud over it, and the
confusion one has something over it that is cloud-like but
shaped differently from Stun as well has being white rather
than black; I'm not sure what that depicts.  This transposes
the Confusion icon so that it faces the player's left shoulder
instead of right.  Not a very emphatic suggestion of confusion
but seems a useful difference without requiring any artistic
competence.
2020-08-08 18:42:26 -07:00
PatR
a8502126d6 Qt menu bandaid
Menu hackery:  change a couple of menu entry names on OSX to
control where they end up.

Move nethack's 'O' command from its hijacked position (due to name
"Options") of "nethack->Preferences..." to "Game->Run-time options".

Move persistent Qt settings on OSX from "Game->Qt settings" to
"nethack->Preferences...".

The Qt settings dialog (now accessed as Preferences...) desperately
needs a title and/or other explanatory text but I haven't figured
out how do to that.  The values set with it are persistent, with
apparently quite a few choices for where to save them for future
runs.  I used it to increase the size of text in the status window,
and found my settings stored in binary file
 ~/Library/Preferences/org.nethack.NetHack.plist
The subdirectories ~/Library and ~/Library/Preferences are
standard OSX per-user things.  The file name is derived from values
set up in main routine:  qt_main.cpp is setting OrganizationDomain
to "nethack.org" and ApplicationName to "NetHack".  I've added a
value for ApplicationVersion but don't know whether anything cares
about it.
2020-08-08 18:21:38 -07:00
PatR
e1cab093bd fix put request #377 - worm mismanagement
An earlier change resulted in place_worm_tail_randomly() sometimes
removing a long worm from the map unintentionally.  It was still on
the monster list so if wizard mode sanity_check option was On, there
would be warnings of a monster which isn't on the map.

The change which triggered this was necessary so I'm inclined to
blame place_worm_tail_randomly() laziness.

This is a superset of the pull request's fix.

Fixes #377
2020-08-07 16:05:11 -07:00
nhw_cron
5851888ba5 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-08-07 11:51:24 -04:00
PatR
46f19f89ac goodbye END-CHOOSE
Instead of an additional options file directive to end the last
section of a CHOOSE directive, simplify by using an empty-name
section, [], instead.  So
...
CHOOSE one,two
[one]
...
[two]
...
[]
...

As with the short-lived END-CHOOSE directive, if no [] is present
then the rest of the file is part of the last choice.
2020-08-07 00:29:28 -07:00
nhmall
daf6294ad7 from cron-daily 2020-08-06 22:18:11 -04:00
PatR
2392832f22 END-CHOOSE directive for .nethackrc
Add an optional way to terminate the last section after a CHOOSE
directive in the run-time options file so that it's possible to
revert to common options.  If no END-CHOOSE directive is present
then the last CHOOSE section continues until the end of the file.
(All existing uses of CHOOSE already behave that way.)

Change the Guidebook to refer to OPTIONS=x, AUTOPICKUP_EXCEPTION=y,
CHOOSE=z, and so on as "directives" rather than "statements".  It
just feels like a better fit.
2020-08-06 15:57:05 -07:00
PatR
318a56669d augment Qt Info menu
Add ^X (as "Attributes (extended status)") to the "Info" drop down
menu, also Overview, and Annotate.

Attributes and Overview work, Annotate results in running southeast.
Existing entries Conduct, Adjust, and Skills execute nethack's '?'
command so I didn't bother holding back on adding Annotate.  Other
existing entries (Inventory, Discoveries, Spells, and Name) work.
If there's any sort of pattern involved, I'm not seeing it.

The Game menu has "Save", which shows up and works, but that's
supposed to be followed by "Quit" which doesn't show up when the
menu is used.  This doesn't attempt to deal with that.

Command+q keystroke, which should close the application, behaves
the same as previously mentioned "quit nethack" in nethack menu:
runs nethack's '?' command and then resumes play.
2020-08-05 12:48:12 -07:00
PatR
addebf7090 Qt "close window" debacle on OSX
Prevent an infinite loop that occurred if player clicked on the
close window button and then tried to cancel out of that in the
dialog it brings up.

I don't know whether Qt interface on platforms other than OSX
need this but they're getting it.  The choices are changed from
"Save" or "Cancel" to "Save and exit" or "Quit without saving".
Since save allows subsequent restore, not being able to cancel
out of the application shutdown should only be an inconvenience.

Unresolved issues:

I don't know whether there's any other way to bring up that dialog,
where Cancel might be a viable choice.  If so, handling that might
be tricky.  Quit should definitely be available as an alterative
to Save, but that type of dialog doesn't seem to allow more than
two choices.

Picking "nethack" from application menu and then "quit nethack"
from the resulting pull down menu results in executing nethack's
help command (the '?' menu) and then just resumes play.
2020-08-05 11:34:56 -07:00
PatR
f4cee951ca ^X on MacOSX Qt
Add Michael's fix for control+x.

The enum name of the argument suggests that option+x should have
been sending control characters but that wasn't the case for me.

Before this fix, both control+x and option+x behaved like dead
keys, not transmitting anything for nethack to use.  After this
fix, control+x sends ^X as desired but option+x is still dead.
2020-08-05 11:26:25 -07:00
PatR
be3edcd097 some qt_main.cpp formatting cleanup 2020-08-05 11:10:57 -07:00
PatR
b8b4fc70da more Qt "about nethack"
The presence of longer lines has made the 'about' box become wider
so combine the first two short lines into one longer one.

Switching to the longer nethack version string resulted in "This
is NetHack MacOSX Nethack ..." so remove the initial "NetHack"
from the 'about' box's format string.  That version string also
includes a final period; strip that off since "with Qt 5.x.y."
follows it to end the sentence.

Still some issues:

The application menu has first entry "nethack" which ought to be
capitalized but I haven't been able to figure out how to accomplish
that.

Some code in qt_main.cpp tries to add an extra instance of "about
NetHack" to the game window's "Help" menu but it doesn't show up.
2020-08-05 10:55:10 -07:00
nhmall
e426f99d25 Use the more detailed version info on Qt 2020-08-05 08:49:58 -04:00