macOS build with latest clang from Xcode

A bunch of new warnings appeared by default on macOS compiler provided with Xcode,
including on every usage of sprintf(). Suppress those for now.

The issues with utilizing WANT_ASAN=1 on the make command line with macOS seem
to be resolved in this latest version, so allow it to be specified. Don't specify
it if using a problematic clang version.
This commit is contained in:
nhmall
2023-04-21 11:33:15 -04:00
parent b26ec2f677
commit 9fd719cbf2
4 changed files with 22 additions and 20 deletions

View File

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