diff options
author | Matthew Smith <matthew@gentoo.org> | 2022-04-14 17:45:51 +0100 |
---|---|---|
committer | Matthew Smith <matthew@gentoo.org> | 2022-04-14 17:45:51 +0100 |
commit | ae4313336418605be6ab3cea43c49297008284fd (patch) | |
tree | 14c21f1a05480cf3108bf44af090aa2cde31ebdb /games-roguelike/nethack/files | |
parent | net-analyzer/icinga2: 2.13.3 bump (diff) | |
download | gentoo-ae4313336418605be6ab3cea43c49297008284fd.tar.gz gentoo-ae4313336418605be6ab3cea43c49297008284fd.tar.bz2 gentoo-ae4313336418605be6ab3cea43c49297008284fd.zip |
games-roguelike/nethack: don't redefine warn_unused_result
Apply patch that should land in NetHack 3.6.7. No revbump as fixes build
failure.
Closes: https://bugs.gentoo.org/830556
Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'games-roguelike/nethack/files')
-rw-r--r-- | games-roguelike/nethack/files/nethack-3.6.6-wunused-result.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/games-roguelike/nethack/files/nethack-3.6.6-wunused-result.patch b/games-roguelike/nethack/files/nethack-3.6.6-wunused-result.patch new file mode 100644 index 000000000000..e26d1190fda3 --- /dev/null +++ b/games-roguelike/nethack/files/nethack-3.6.6-wunused-result.patch @@ -0,0 +1,37 @@ +From 1cb5dc04605daa45f1c6a647c17442ed7ff2fe4e Mon Sep 17 00:00:00 2001 +From: nhmall <nhmall@nethack.org> +Date: Tue, 4 Jan 2022 08:24:08 -0500 +Subject: [PATCH] work around ubuntu 20.10 build issue + +NetHack was trying to suppress warn_unused_result +in include/tradstdc.h, by defining warn_unused_result +to an empty string. That began causing a build error +in a system-supplied header file cdefs.h +when using 20.10 ubuntu impish. + +Try skipping that in tradstdc.h for any linux, unless +the NetHack build defines GCC_URWARN to force it into +play. +--- + include/tradstdc.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/tradstdc.h b/include/tradstdc.h +index 09decb4b15..8c33d55e0a 100644 +--- a/include/tradstdc.h ++++ b/include/tradstdc.h +@@ -405,12 +405,14 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ + #if __GNUC__ >= 3 + #define UNUSED __attribute__((unused)) + #define NORETURN __attribute__((noreturn)) ++#if !defined(__linux__) || defined(GCC_URWARN) + /* disable gcc's __attribute__((__warn_unused_result__)) since explicitly + discarding the result by casting to (void) is not accepted as a 'use' */ + #define __warn_unused_result__ /*empty*/ + #define warn_unused_result /*empty*/ + #endif + #endif ++#endif + + #ifndef PRINTF_F + #define PRINTF_F(f, v) |