From 3d28985f6bda2daf52dafd8fdca3b71be104d31d Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Wed, 9 Jul 2025 17:41:14 +0200 Subject: [PATCH] move includes from terminal.c to terminal.h, hide build warnings on unrar when using clang --- include/terminal.h | 11 ++++++----- src/Makefile | 2 ++ src/terminal.c | 7 ------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/terminal.h b/include/terminal.h index 1946e0c6e..083bb49a8 100644 --- a/include/terminal.h +++ b/include/terminal.h @@ -18,15 +18,16 @@ #include #if defined (__APPLE__) #include +#include #endif // __APPLE__ #endif // _WIN -#if !defined (_WIN) && !defined (__CYGWIN__) && !defined (__MSYS__) +#if defined (_POSIX) #include -#if !defined (__linux__) -#include -#endif // ! __linux__ -#endif // ! _WIN && | __CYGWIN__ && ! __MSYS__ +#if !defined (__APPLE__) +#include +#endif // ! __APPLE__ +#endif // _POSIX void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag); void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop); diff --git a/src/Makefile b/src/Makefile index 2cfbf9406..cf85746aa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -236,6 +236,8 @@ ifneq ($(CC),clang) CFLAGS_UNRAR += -Wno-class-memaccess CFLAGS_UNRAR += -Wno-misleading-indentation CFLAGS_UNRAR += -Wno-format-overflow +else +CFLAGS_UNRAR += -Wno-nontrivial-memcall endif CFLAGS_UNRAR += -Wno-missing-braces CFLAGS_UNRAR += -Wno-unused-variable diff --git a/src/terminal.c b/src/terminal.c index c36cf4c20..8d5562b15 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -17,13 +17,6 @@ #include "timer.h" #include "terminal.h" -#if defined (_POSIX) -#include -#if !defined (__APPLE__) -#include -#endif -#endif - static const size_t MAXIMUM_EXAMPLE_HASH_LENGTH = 200; static const size_t TERMINAL_LINE_LENGTH = 79;