nethack: fix for gcc-12

This commit is contained in:
Abdul Rehman 2022-12-03 10:18:56 +05:00 committed by Đoàn Trần Công Danh
parent 5f2aaea03e
commit 584f33ae7d
1 changed files with 14 additions and 0 deletions

View File

@ -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