[clang] [clang-fuzzer] Remove GCC 4.9 workaround to silence warning (PR #73974)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 30 12:02:35 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Brad Smith (brad0)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/73974.diff
1 Files Affected:
- (modified) clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp (-16)
``````````diff
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);
``````````
</details>
https://github.com/llvm/llvm-project/pull/73974
More information about the cfe-commits
mailing list