Skip to content

Conversation

@zhuzeitou
Copy link
Contributor

The -Ofast flag is deprecated in Clang 19 and later, causing frequent warnings during the build.
Exclude -Ofast for Clang versions >= 19 to suppress these warnings.

@github-actions github-actions bot added the core label Jan 21, 2026
@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Suppress Clang 19+ build warnings by preventing use of the deprecated -Ofast flag when building in Release mode.

Changes:

  • Update Release-mode compile flag logic to skip -Ofast for Clang versions >= 19.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (0deee81) to head (6c99acb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6520      +/-   ##
==========================================
- Coverage   93.08%   93.07%   -0.01%     
==========================================
  Files         809      809              
  Lines      256380   256467      +87     
==========================================
+ Hits       238651   238712      +61     
- Misses      17729    17755      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nihui
Copy link
Member

nihui commented Jan 21, 2026

aha, apple clang still suffers from the deprecation warnings :)

@zhuzeitou
Copy link
Contributor Author

aha, apple clang still suffers from the deprecation warnings :)

AppleClang 17 is based on Clang 19, but its version number is less than 19.0.
I removed -Ofast for all Clang variants, since -Ofast is equivalent to -O3 -ffast-math in Clang, and the Release build type already provide -O3 and the script appends -ffast-math immediately after.

The -Ofast flag is deprecated in Clang 19 and later, causing frequent
warnings during the build.
Exclude -Ofast for Clang versions >= 19 to suppress these warnings.
AppleClang 17 is based on LLVM Clang 19, but its version number is numerically less than 19.0.
Since `-Ofast` in Clang is equivalent to `-O3 -ffast-math`, `-Ofast` is redundant. This commit disables `-Ofast` for all Clang-based compilers (including AppleClang) to resolve the version mismatch and avoid future deprecation issues.
@zhuzeitou zhuzeitou force-pushed the disable-ofast-clang19 branch from 7d1ccf7 to 6c99acb Compare January 24, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants