From b8a38e2bc1a6acae1b9a91dc082aafafe4af0911 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 11 Aug 2018 15:36:04 -0400 Subject: [PATCH] ArchitectureRules: Move Clang warning flags to appropriate location. Also tweak the no-delete-null-pointer-checks comment so it's slightly less offending of the 80-chars rule. --- build/jam/ArchitectureRules | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 2f9c2b23f3..91a44caa90 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -29,11 +29,11 @@ rule ArchitectureSetup architecture # Without this flag, GCC deletes many null-pointer checks that are # technically undefined behavior (e.g. passing NULL to strdup, among # others), which breaks both the kernel and various applications. See: - # - https://www.freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization + # - https://freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization # - https://dev.haiku-os.org/ticket/13285#comment:8 (& subsequent comments) # - https://dev.haiku-os.org/ticket/10803#comment:4 (& subsequent comments) # Note that the Linux also does the same: - # - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3ca86aea507904148870946d599e07a340b39bf + # - https://github.com/torvalds/linux/commit/a3ca86aea507904 if $(gccVersion[1]) >= 3 { ccBaseFlags += -fno-delete-null-pointer-checks ; } @@ -43,12 +43,6 @@ rule ArchitectureSetup architecture ccBaseFlags += -fno-builtin-fork -fno-builtin-vfork ; } - # disable some Clang warnings that are not very useful - if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 { - ccBaseFlags += -Wno-address-of-packed-member -Wno-unused-private-field - -Wno-cast-align -Wno-gnu-designator ; - } - # default architecture tuning local cpu = $(HAIKU_CPU_$(architecture)) ; local archFlags ; @@ -126,6 +120,11 @@ rule ArchitectureSetup architecture HAIKU_WARNING_C++FLAGS_$(architecture) = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ; + # disable some Clang warnings that are not very useful + if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 { + ccBaseFlags += -Wno-address-of-packed-member -Wno-unused-private-field + -Wno-cast-align -Wno-gnu-designator ; + } HAIKU_WERROR_FLAGS_$(architecture) = ;