Fix Ruby 3.3 / GCC 15 incompatible pointer type error#6
Open
edusantana wants to merge 2 commits into
Open
Conversation
GCC 15 treats -Wincompatible-pointer-types as a hard error. The inline C soundex implementation triggers this with Ruby 3.3's updated rb_define_method signature. Fall back to the existing pure-Ruby implementation on MRI 3.3+.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GCC 15 (shipped with Ubuntu 26.04) promotes
-Wincompatible-pointer-typesto a hard error. Two files useRubyInlineto compile C extensions at load time, and both trigger this error with Ruby 3.3's updatedrb_define_methodunion-based callback type:lib/fuzzy_tools/helpers.rb— inline Csoundexlib/fuzzy_tools/weighted_document_tokens.rb— inline Ccosine_similarity_fastBoth files already have a complete pure-Ruby fallback used for JRuby/rbx. The fix extends that fallback to also apply on MRI 3.3+, where the C extensions no longer compile.
Fix
One-line change per file — extend the existing condition:
Tested on