Commit Graph

157 Commits

Author SHA1 Message Date
fox
0056d140e3 games/hack: Suppress -Werror=stringop-truncation error.
Add GCC_NO_STRINGOP_TRUNCATION to hack.end.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-08 00:59:55 +00:00
fox
a0c9b60242 games/hack: Revert the strlcpy(1) change since this changes expected behavior from strncpy(3).
Reviewed by: kamil@
2020-02-07 22:04:02 +00:00
fox
f183a7a695 games/hack: Fix -Wstringop-truncation warning.
Replace strncpy(3) with strlcpy(3).

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-07 20:34:18 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg
9c07d7ddd1 - done() can return in wizard mode. don't NOTREACHED'd it
but break instead.
2019-02-04 03:33:15 +00:00
mrg
37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
snj
75815ac0a1 1) "It's its"
2) Whitespace
3) You're all too old to be confusing "your" with "you're"
2014-10-18 06:40:18 +00:00
dholland
277bd0756c WARNS=5, and make WARNS=5 the default for src/games. 2012-06-19 05:46:08 +00:00
roy
4060cbcd0c Use tiparm instead of vtparm. 2011-10-03 12:32:15 +00:00
plunky
acae68523e reinstate NULL cast by request, where the NULL was being passed as a vararg 2011-09-01 07:18:50 +00:00
plunky
9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
joerg
17834822b6 Mark error() as dead, so that validation for setclipped works correctly. 2011-08-27 23:42:33 +00:00
dholland
ae56ae8f3f Use __dead and __printflike instead of __attribute__. 2011-08-26 06:18:16 +00:00
plunky
e2bd4b0723 -Wno-shadow is no longer needed for HAVE_PCC, here 2011-08-24 17:39:32 +00:00
christos
72db7ca912 - document non-literal format strings
- avoid strict aliasing violations, but adding an intermediate function.
2011-08-16 09:26:22 +00:00
dholland
d5b021c7ed Fix up some lint. 2011-08-07 06:03:45 +00:00
dholland
2c0ecb1ab6 Fix up still more casts; use NULL instead of (char *)0. 2011-08-06 20:42:43 +00:00
dholland
8041af98f6 Remove *another* set of useless casts. sheesh 2011-08-06 20:32:25 +00:00
dholland
8e73b3ad76 Remove more silly casts. 2011-08-06 20:29:37 +00:00
dholland
5aa2a843dc drop private (and wrong) definition of NULL 2011-08-06 20:24:35 +00:00
dholland
434d266e91 Use the right type for the malloc wrapper function, and don't cast the
return value.

(XXX: Except for a pile of allocation macros that produce typed pointer
results; there the typechecking of the result assignment is more valuable
than the warning if the alloc function isn't declared properly. These
macros should go away.)
2011-08-06 20:18:26 +00:00
dholland
25ec296591 Remove silly casts. 2011-08-06 20:00:33 +00:00
dholland
842dc544ae <sys/wait.h> is standard, so just use it instead of fiddling about with
ifdefs for long-dead systems. While here, remove union wait.
2011-08-06 19:53:24 +00:00
dholland
d30849d1cd abolish references to index/rindex 2011-08-06 19:47:54 +00:00
dholland
813e3e415d Remove the PYRAMID_BUG code. I don't think Pyramids are coming back, nor
do we care if their compiler vomits trying to decrement a bitfield.
2011-08-06 19:32:58 +00:00
dholland
cbc660deee Don't refer to index() in comments; use strchr(). 2011-08-06 19:23:38 +00:00
dholland
fcfbc606bf Include system headers before private headers. Avoids various possible
symbol conflicts.
2011-07-20 07:04:30 +00:00
mrg
1a1e24f1e6 include sys/time.h earlier (rather than implicitly via fcntl.h) so that
the "u" variable doesn't shadow stuff, found later in time.h inlines.

kind of a hack, but i don't want to modify time.h either.

XXX: seems kind of annoying
2011-07-02 02:10:33 +00:00
mrg
d060781d89 rename a variable from "time" to "stime" (it's a string) 2011-07-02 02:09:08 +00:00
mrg
c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
joerg
ab7b7d013a Use consistent sign in compare, the function is only called with
constants as third argument anyway.
2011-05-30 03:11:15 +00:00
joerg
57c13365a3 Correctly print variables as strings, not as format string. 2011-05-23 22:53:25 +00:00
roy
98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
wiz
32b30fe688 Simplify alloc() to avoid ifdef(LINT) workaround. 2010-01-17 22:55:20 +00:00
dholland
9b92b18917 sprinkle static 2009-08-12 07:28:40 +00:00
dholland
165c915b22 Fix two serious string-handling bugs (one exploitable, one probably
exploitable) and also add proper checking/paranoia in several other
places.
2009-06-29 23:05:33 +00:00
dholland
b8c355d789 a bit more const 2009-06-07 21:04:54 +00:00
dholland
a7a3b831c7 sprinkle some more const 2009-06-07 20:31:10 +00:00
dholland
8d5216e80d remove unnecessary casts 2009-06-07 20:25:38 +00:00
dholland
907fca1b3e sprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate
XXX: there's still one sprintf left which will take some hacking to expunge.
2009-06-07 20:13:18 +00:00
dholland
1fa8a9a633 ANSIfy function declarations. All object file diffs inspected. 2009-06-07 18:30:39 +00:00
ginsbach
37a52c5f7b Change getdate() to getdatestr() since the former maybe present on systems
supporting X/Open System Interfaces Extension (XSI) getdate() in <time.h>.
This prevents a function prototype conflict.
2009-05-06 02:59:12 +00:00
tnn
f341bbffe8 use %zu to print size_t 2009-01-18 13:30:33 +00:00
lukem
c6144e484f fix -Wsign-compare issues 2009-01-18 00:24:29 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dholland
3c439f438f Make hack build with WARNS=4. 2008-01-28 06:55:41 +00:00
perry
8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
chuck
f90603d08a Update my previous commit to better match the original code, including
the check for 'bs'...   my previous commit should have included the
following text:
  fixes problem introduced in 1.13 where the setting of "BC" (backspace char)
  was left to libterm rather than being done by hack itself.  the problem
  with this was that hack was directly setting BC to \b if there was no
  "bc" in the termcap entry, but libterm does not do this.   this resulted in
  the xputs(BC) calls in nocmov() and backsp() incorrectly doing nothing, thus
  messing up the display.  added new var BC_BS to provide the old behavior
  for nocmov() and backsp().
2007-01-17 02:35:28 +00:00
chuck
bfec35be7a mrg's changes in 1.13 broke hack's display code. 2007-01-17 02:12:19 +00:00