[clang] [clang-fuzzer] Remove GCC 4.9 workaround to silence warning (PR #73974)

Brad Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 12:02:01 PST 2023


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/73974

The minimum GCC version was bumped up from 4.8 to 5.1 and then even newer awhile ago so garbage collect the 4.9 workaround.

https://reviews.llvm.org/D66188

>From 5897fa680892ea05759f038554ea190fda92172c Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Thu, 30 Nov 2023 14:53:34 -0500
Subject: [PATCH] [clang-fuzzer] Remove GCC 4.9 workaround to silence warning

The minimum GCC version was bumped up from 4.8 to 5.1 and then even newer
awhile ago so garbage collect the 4.9 workaround.

https://reviews.llvm.org/D66188
---
 .../clang-fuzzer/handle-llvm/handle_llvm.cpp     | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp b/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
index 3d39d69e6c2b422..798b34b3ef0afd2 100644
--- a/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
+++ b/clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
@@ -185,23 +185,7 @@ static void CreateAndRunJITFunc(const std::string &IR, CodeGenOptLevel OLvl) {
   EE->finalizeObject();
   EE->runStaticConstructorsDestructors(false);
 
-#if defined(__GNUC__) && !defined(__clang) &&                                  \
-    ((__GNUC__ == 4) && (__GNUC_MINOR__ < 9))
-// Silence
-//
-//   warning: ISO C++ forbids casting between pointer-to-function and
-//   pointer-to-object [-Wpedantic]
-//
-// Since C++11 this casting is conditionally supported and GCC versions
-// starting from 4.9.0 don't warn about the cast.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
   LLVMFunc f = reinterpret_cast<LLVMFunc>(EE->getPointerToFunction(EntryFunc));
-#if defined(__GNUC__) && !defined(__clang) &&                                  \
-    ((__GNUC__ == 4) && (__GNUC_MINOR__ < 9))
-#pragma GCC diagnostic pop
-#endif
 
   // Figure out if we are running the optimized func or the unoptimized func
   RunFuncOnInputs(f, (OLvl == CodeGenOptLevel::None) ? UnoptArrays : OptArrays);



More information about the cfe-commits mailing list