From c5769c4f6b174b75e7c4b8a93650662c07b8dcfd Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sun, 24 Feb 2019 09:36:55 +0100 Subject: [PATCH] Make -Wcast-align only a warning On x86 and x86_64, this warning is never emitted because it is perfectly fine to do unaligned access. On sparc, such accesses are not supported by the hardware and will generate a SIGBUS. This must be caught by a trap handler, and the unaligned access performed there, slowly, using byte by byte access. However, making this a Werror is annoying because it will trigger everytime one casts a byte pointer to something larger, even when alignment is actually preserved. So, removing all such warnings would be nearly impossible (for example, just for the mergesort function, there is a whole GSoC project for it at FreeBSD). Keep it as a warning for now. The warning can be silenced by using BytePointer, if desired. We should also investigate where the SIGBUS trap is triggered a lot and consider improving the alignment of data where possible. Change-Id: I6b90025e8c6d69ef1ccda3c10eee270ccc1ebd29 Reviewed-on: https://review.haiku-os.org/c/1103 Reviewed-by: waddlesplash --- build/jam/ArchitectureRules | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index ce36276b3c..31c3eb72c8 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -115,12 +115,14 @@ rule ArchitectureSetup architecture # warning flags HAIKU_WARNING_CCFLAGS_$(architecture) = -Wall -Wno-multichar - -Wpointer-arith -Wcast-align -Wsign-compare - -Wmissing-prototypes ; + -Wpointer-arith -Wsign-compare + -Wmissing-prototypes + -Wcast-align -Wno-error=cast-align ; HAIKU_WARNING_C++FLAGS_$(architecture) = -Wall -Wno-multichar - -Wpointer-arith -Wcast-align -Wsign-compare - -Wno-ctor-dtor-privacy -Woverloaded-virtual ; + -Wpointer-arith -Wsign-compare + -Wno-ctor-dtor-privacy -Woverloaded-virtual + -Wcast-align -Wno-error=cast-align ; # disable some Clang warnings that are not very useful if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {