From e12026f10137439e023cc5c89ccb0061d3a2d672 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Sun, 13 Oct 2024 11:51:11 +0100 Subject: [PATCH] Fix previous commit on gcc 9 and 10 --- src/Makefile | 3 +++ src/debuginfo.cpp | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index a6b1f433b73ce6..4deb7a9824e377 100644 --- a/src/Makefile +++ b/src/Makefile @@ -22,6 +22,9 @@ FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -Wno-comment -Wpointer-arith -Wundef ifeq ($(USEGCC),1) # GCC bug #25509 (void)__attribute__((warn_unused_result)) FLAGS += -Wno-unused-result +# GCC is throwing warnings like `warning: 'int __builtin_memcmp_eq(const void*, const void*, long unsigned int)' specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807` in llvm's StringRef.h == seemingly because it doesn't realise the size can't be 0. +FLAGS += -Wno-stringop-overflow +FLAGS += -Wno-stringop-overread endif JCFLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 4d217fdd661cf7..f6fca47e9a889d 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -42,13 +42,6 @@ using namespace llvm; #include "julia_assert.h" #include "debug-registry.h" -#ifdef _COMPILER_GCC_ -// GCC is throwing warnings like `warning: 'int __builtin_memcmp_eq(const void*, const void*, long unsigned int)' specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807` in llvm's StringRef.h == seemingly because it doesn't realise the size can't be 0. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstringop-overread" -#pragma GCC diagnostic ignored "-Wstringop-overflow" -#endif - static JITDebugInfoRegistry *DebugRegistry = new JITDebugInfoRegistry; static JITDebugInfoRegistry &getJITDebugRegistry() JL_NOTSAFEPOINT { @@ -1651,7 +1644,3 @@ uint64_t jl_getUnwindInfo_impl(uint64_t dwAddr) jl_unlock_profile(); return ipstart; } - -#ifdef _COMPILER_GCC_ -#pragma GCC diagnostic pop -#endif \ No newline at end of file