Files
nethack/include
nhmall a6631e3bb0 suppress a particular warning for an individual function; useful for non-gcc
Microsoft and other non-GNU compilers don't recognize gcc tricks
like  /*NOTREACHED*/ to suppress individual warnings. clang recognizes most
of them because it tries to be gcc-compatible. Because of that, a lot of
potentially useful warnings have had to be completely suppressed in the
past in all source files when using the non-gcc compatible compilers.

Now that the code is C99, take advantage of a way to suppress warnings for
individual functions, a big step up from suppressing the warnings
altogether.

Unfortunately, it does require a bit of ugliness caused by the
insertion of some macros in a few spots, but I'm not aware of
a cleaner alternative that still allows warnings to be enabled
in general, while suppressing a warning for known white-listed
instances.

Prior to the warning-tiggering function, place whichever one of
the following is needed to suppress the warning being encountered:

DISABLE_WARNING_UNREACHABLE_CODE
DISABLE_WARNING_CONDEXPR_IS_CONSTANT

After the warning-triggering function, place this:

RESTORE_WARNINGS

Under the hood, the compiler-appropriate warning-disabling
mechanics involve the use of C99 _Pragma, which can be used
in macros.

For unrecognized or inappropriate compilers, or if
DISABLE_WARNING_PRAGMAS is defined, the macros expand
to nothing.
2021-02-01 12:54:19 -05:00
..
2021-01-03 13:37:25 -06:00
2020-11-01 14:30:25 -08:00
2020-10-14 09:25:45 -07:00
2020-09-28 16:25:31 -04:00
2021-01-23 15:02:11 -08:00
2021-01-26 21:06:16 -05:00
2020-11-13 20:27:17 +02:00
2020-12-27 10:45:13 -05:00
2020-01-29 10:29:37 -05:00
2021-01-26 21:06:16 -05:00
2021-01-31 13:58:19 -05:00
2019-01-28 10:02:08 +01:00
2021-01-20 22:18:34 -06:00
2021-01-26 21:06:16 -05:00
2020-12-04 09:30:21 +02:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-01 22:07:54 -05:00
2020-12-13 10:27:49 -05:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-31 09:20:25 -05:00
2020-08-12 16:15:28 -07:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-31 14:15:08 -05:00
2020-12-08 12:58:36 -08:00
2021-01-31 12:49:22 -05:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-26 21:06:16 -05:00
2021-01-28 21:12:06 -06:00
2021-01-26 10:27:51 -05:00