diff --git a/sys/share/uudecode.c b/sys/share/uudecode.c index 3a73dd087..9d2eacbb1 100644 --- a/sys/share/uudecode.c +++ b/sys/share/uudecode.c @@ -60,10 +60,6 @@ #endif #endif -#if __APPLE__ -#include "config.h" -#endif - /* * uudecode [input] * @@ -85,7 +81,9 @@ #include #endif -#include "warnings.h" +/* #include "warnings.h" */ +#define DISABLE_WARNING_UNREACHABLE_CODE +#define RESTORE_WARNINGS static void decode(FILE *, FILE *); static void outdec(char *, FILE *, int); @@ -130,7 +128,7 @@ main(int argc, char **argv) } (void) sscanf(buf, "begin %o %s", &mode, dest); -#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(MACOS) +#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(__APPLE__) /* handle ~user/file format */ if (dest[0] == '~') { char *sl; @@ -154,7 +152,7 @@ main(int argc, char **argv) strcat(dnbuf, sl); strcpy(dest, dnbuf); } -#endif /* !defined(MSDOS) && !defined(VMS) */ +#endif /* !MSDOS && !VMS && !WIN32 && !__APPLE__ */ /* create output file */ #if defined(MSDOS) || defined(WIN32) @@ -239,7 +237,8 @@ outdec(char *p, FILE *f, int n) putc(c3, f); } -#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(MACOS) +#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(__APPLE__) + /* * Return the ptr in sp at which the character c appears; * NULL if not found diff --git a/sys/unix/hints/include/compiler.370 b/sys/unix/hints/include/compiler.370 index 4d5b57346..bfeefca78 100755 --- a/sys/unix/hints/include/compiler.370 +++ b/sys/unix/hints/include/compiler.370 @@ -29,9 +29,9 @@ CCFLAGS = -g # CPLUSPLUS_NEED_DEPSUPPRESS = 1 C++ -Wno-deprecated-copy, # -Wno-deprecated-declarations -#ifeq "$(WANT_ASAN)" "1" -#NEED_ASAN=1 -#endif +ifeq "$(WANT_ASAN)" "1" +USE_ASAN=1 +endif # If you want to override the compiler detection just carried out # uncomment one of the following pairs. Note, however, that @@ -63,10 +63,6 @@ CFLAGS+=-Wmissing-prototypes CFLAGS+=-Wold-style-definition CFLAGS+=-Wstrict-prototypes -#ifeq "$(NEED_ASAN)" "1" -#CFLAGS+=-fsanitize=address -#endif - #detection of clang vs gcc CCISCLANG := $(shell echo `$(CC) --version` | grep clang) ifeq "$(CCISCLANG)" "" @@ -89,6 +85,10 @@ endif # GCC greater than or equal to 9 else # gcc or clang? CXX=clang++ -std=gnu++11 # clang-specific follows +CLANGGTEQ14 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 14) +ifeq "$(CLANGGTEQ14)" "1" +CFLAGS+=-Wno-deprecated-declarations +endif # none endif # clang-specific ends here @@ -139,6 +139,9 @@ CLANGPPGTEQ14 := $(shell expr `$(CXX) -dumpversion | cut -f1 -d.` \>= 14) ifeq "$(CLANGPPGTEQ9)" "1" #CCXXFLAGS+=-Wformat-overflow endif +ifeq "$(CLANGPPGTEQ14)" "1" +CPLUSPLUS_NEED_DEPSUPPRESS=1 +endif ifdef CPLUSPLUS_NEED_DEPSUPPRESS CCXXFLAGS+=-Wno-deprecated CCXXFLAGS+=-Wno-deprecated-declarations diff --git a/sys/unix/hints/linux.370 b/sys/unix/hints/linux.370 index c6393ad32..2cdfdf0de 100755 --- a/sys/unix/hints/linux.370 +++ b/sys/unix/hints/linux.370 @@ -56,7 +56,8 @@ endif # WANT_WIN_QT # #-INCLUDE multiw-3.370 -ifeq "$(NEED_ASAN)" "1" +ifeq "$(USE_ASAN)" "1" +CFLAGS+=-fsanitize=address LFLAGS+=-fsanitize=address endif diff --git a/sys/unix/hints/macOS.370 b/sys/unix/hints/macOS.370 index d8c54c688..8f2c1c296 100755 --- a/sys/unix/hints/macOS.370 +++ b/sys/unix/hints/macOS.370 @@ -72,10 +72,9 @@ endif # WANT_WIN_QT #-INCLUDE multiw-3.370 -ifdef NEED_ASAN -ifeq "$(NEED_ASAN)" "1" -#LFLAGS +=-fsanitize=address -endif +ifeq "$(USE_ASAN)" "1" +CFLAGS +=-fsanitize=address +LFLAGS +=-fsanitize=address endif # NetHack sources control