From 5ae52296a82a5732cfc3c796f087d1d1210b7728 Mon Sep 17 00:00:00 2001 From: Abdul Rehman <7r3nzy@gmail.com> Date: Sat, 3 Dec 2022 10:18:56 +0500 Subject: [PATCH] nethack: fix for gcc-12 --- srcpkgs/nethack/patches/2-gcc12.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 srcpkgs/nethack/patches/2-gcc12.patch diff --git a/srcpkgs/nethack/patches/2-gcc12.patch b/srcpkgs/nethack/patches/2-gcc12.patch new file mode 100644 index 000000000000..df7ed8df5e2c --- /dev/null +++ b/srcpkgs/nethack/patches/2-gcc12.patch @@ -0,0 +1,14 @@ +--- a/include/tradstdc.h ++++ b/include/tradstdc.h +@@ -431,7 +431,11 @@ + #define NORETURN __attribute__((noreturn)) + /* disable gcc's __attribute__((__warn_unused_result__)) since explicitly + discarding the result by casting to (void) is not accepted as a 'use' */ ++#if __GNUC__ >= 11 ++#define __warn_unused_result__ unused ++#elif + #define __warn_unused_result__ /*empty*/ ++#endif + #define warn_unused_result /*empty*/ + #endif + #endif