Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-fuzzer] Remove GCC 4.x pre GCC 4.9 workaround to silence warning #73974

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Nov 30, 2023

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

https://reviews.llvm.org/D66188

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Nov 30, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 30, 2023

@llvm/pr-subscribers-clang

Author: Brad Smith (brad0)

Changes

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 --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);

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

https://reviews.llvm.org/D66188
@brad0 brad0 force-pushed the clang-fuzzer_gcc_4.9_workaround branch from 5897fa6 to 30168e3 Compare November 30, 2023 20:05
@brad0 brad0 changed the title [clang-fuzzer] Remove GCC 4.9 workaround to silence warning [clang-fuzzer] Remove GCC 4.x pre GCC 4.9 workaround to silence warning Nov 30, 2023
@brad0 brad0 requested review from nikic and aeubanks December 2, 2023 06:59
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brad0 brad0 merged commit 37da4e3 into llvm:main Dec 2, 2023
3 checks passed
@brad0 brad0 deleted the clang-fuzzer_gcc_4.9_workaround branch December 2, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants