From 644e2db8ba2d30d82e080a2030eef30c9ef7d960 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Tue, 28 Dec 2021 21:26:08 +0100 Subject: [PATCH 1/2] Fix build warning with clang <= 10 --- src/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Makefile b/src/Makefile index 7aba2540b..ad2cd0e14 100644 --- a/src/Makefile +++ b/src/Makefile @@ -76,6 +76,9 @@ AR := /usr/bin/ar SED := /usr/bin/sed SED_IN_PLACE := -i "" DARWIN_VERSION := $(shell uname -r | cut -d. -f1) +CLANG_VERSION := $(shell $(CC) --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\.*[0-9]*" | head -n 1) +CLANG_VERSION_NUMBER := $(shell echo $(CLANG_VERSION) | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/') +CLANG_VERSION_GT_10 := $(shell expr $(CLANG_VERSION_NUMBER) \> 100000) endif ifeq ($(UNAME),FreeBSD) @@ -194,8 +197,12 @@ endif ifeq ($(USE_SYSTEM_LZMA),0) CFLAGS_LZMA += -D_7ZIP_ST +ifneq ($(CC),clang) +CFLAGS_LZMA += -Wno-misleading-indentation +else ifeq ($(CLANG_VERSION_GT_10),1) CFLAGS_LZMA += -Wno-misleading-indentation endif +endif ## because ZLIB ifeq ($(USE_SYSTEM_ZLIB),0) @@ -212,6 +219,8 @@ ifeq ($(USE_SYSTEM_UNRAR),0) ifneq ($(CC),clang) CFLAGS_UNRAR += -Wno-class-memaccess CFLAGS_UNRAR += -Wno-misleading-indentation +else ifeq ($(CLANG_VERSION_GT_10),1) +CFLAGS_UNRAR += -Wno-misleading-indentation endif CFLAGS_UNRAR += -Wno-missing-braces CFLAGS_UNRAR += -Wno-unused-variable From 85afe0fc5a5ffb33d1563cb2ae583a4b40b6dd43 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Thu, 30 Dec 2021 13:34:43 +0100 Subject: [PATCH 2/2] simplify Makefile --- src/Makefile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Makefile b/src/Makefile index ad2cd0e14..1443d4d5c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -76,9 +76,6 @@ AR := /usr/bin/ar SED := /usr/bin/sed SED_IN_PLACE := -i "" DARWIN_VERSION := $(shell uname -r | cut -d. -f1) -CLANG_VERSION := $(shell $(CC) --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\.*[0-9]*" | head -n 1) -CLANG_VERSION_NUMBER := $(shell echo $(CLANG_VERSION) | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/') -CLANG_VERSION_GT_10 := $(shell expr $(CLANG_VERSION_NUMBER) \> 100000) endif ifeq ($(UNAME),FreeBSD) @@ -199,8 +196,6 @@ ifeq ($(USE_SYSTEM_LZMA),0) CFLAGS_LZMA += -D_7ZIP_ST ifneq ($(CC),clang) CFLAGS_LZMA += -Wno-misleading-indentation -else ifeq ($(CLANG_VERSION_GT_10),1) -CFLAGS_LZMA += -Wno-misleading-indentation endif endif @@ -219,8 +214,6 @@ ifeq ($(USE_SYSTEM_UNRAR),0) ifneq ($(CC),clang) CFLAGS_UNRAR += -Wno-class-memaccess CFLAGS_UNRAR += -Wno-misleading-indentation -else ifeq ($(CLANG_VERSION_GT_10),1) -CFLAGS_UNRAR += -Wno-misleading-indentation endif CFLAGS_UNRAR += -Wno-missing-braces CFLAGS_UNRAR += -Wno-unused-variable