Files
nethack/include
PatR 9de8b03c03 X11 lint suppression
Suppress close to 400 warnings generated by gcc on the win/X11/*.c code,
most due to -Wwrite-strings which makes string literals implicitly have
the 'const' attribute.  (Since modifying a string literal results in
undefined behavior, that is an appropriate check to have enabled, but
it can be troublesome since string literals have type 'char *' and code
that uses them that way is correct provided it avoids modifying them.)

 113  warning: initialization discards qualifiers from pointer target type
 127  warning: assignment discards qualifiers from pointer target type
  29  warning: passing argument discards qualifiers from pointer target type
 109  warning: unused parameter
  12  warning: comparison between signed and unsigned

The nhStr() hack casts to 'char *', explicitly removing 'const', for
situations where it isn't feasible to make code directly honor const.
The vast marjority of uses are for the second parameter to XtSetArg(),
which is a macro that actually performs an assignment with the second
argument rather than passing it in a function.  It takes values like
'XtNtop', which doesn't need to be altered (although in many places I
changed that to nhStr(XtNtop) for uniformity with the surrounding code,
and 'XtNbottom', which does need to have the extra const stripping to
avoid a warning.  Go figure.

The nhUse() hack actually uses its argument in a meaningless way if the
code is compiled with FORCE_ARG_USAGE defined.  When GCC_WARN is defined,
FORCE_ARG_USAGE will be enabled if it hasn't been already.  Example:

 /*ARGUSED*/
 int foo(arg)
   int arg;  /* not used */
 {
+  nhUse(arg);
   return 0;
 }

The extra line will expand to ';' when FORCE_ARG_USAGE is not defined
or too
   nhUse_dummy += (unsigned)arg;
when it is.  I figured direct assignment might lead to a different
warning by some compilers in a situation like
   nhUse(arg);
   nhUse(otherarg);
where the first assignment would be clobbered by the second, and using
bitwise operations or safer '+= (arg != 0)' would most likely generate
more non-useful code.  Some tweaking might turn out to be necessary.
2015-05-06 00:59:15 -07:00
..
2015-03-17 18:46:01 +02:00
2002-01-05 21:05:47 +00:00
2015-04-13 21:11:44 +03:00
2015-04-13 18:30:53 +03:00
2015-04-22 19:47:55 -07:00
2015-03-17 18:46:12 +02:00
2015-05-01 22:03:13 +03:00
2015-04-13 21:11:44 +03:00
2002-01-05 21:05:47 +00:00
2015-03-20 00:58:29 -04:00
2015-05-06 00:38:16 -07:00
2015-05-06 00:38:16 -07:00
2002-01-05 21:05:47 +00:00
2015-03-17 18:46:35 +02:00
2015-03-17 18:52:42 +02:00
2015-03-17 18:46:32 +02:00
2015-04-27 21:09:26 +03:00
2015-03-17 18:46:35 +02:00
2015-03-17 18:46:23 +02:00
2015-03-17 18:46:41 +02:00
2015-04-20 00:05:00 -07:00
2015-03-17 18:46:41 +02:00
2015-03-17 18:46:01 +02:00
2002-01-05 21:05:48 +00:00
2015-04-09 13:27:44 -04:00
2015-03-17 18:45:49 +02:00
2015-03-17 18:46:17 +02:00
2015-03-17 18:47:17 +02:00
2015-03-17 18:46:41 +02:00
2015-05-06 00:59:15 -07:00
2015-04-20 00:05:00 -07:00