Skip to content

Suppress -Wunused-function#820

Merged
byroot merged 1 commit into
ruby:masterfrom
k0kubun:unused-simd-h
Jun 30, 2025
Merged

Suppress -Wunused-function#820
byroot merged 1 commit into
ruby:masterfrom
k0kubun:unused-simd-h

Conversation

@k0kubun
Copy link
Copy Markdown
Member

@k0kubun k0kubun commented Jun 30, 2025

I saw a compiler warning when compiling ruby/ruby. This PR attempts to suppress it by making it an inline function, which is usually not warned by -Wunused-function.

In file included from ../../../../ext/json/parser/parser.c:23:
../../../../ext/json/parser/../simd/simd.h:186:28: warning: ‘find_simd_implementation’ defined but not used [-Wunused-function]
  186 | static SIMD_Implementation find_simd_implementation(void) {
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~

I'm not sure why it's happening (or HAVE_SIMD is not defined) on my ruby build, but it does seem unused in parser.c when HAVE_SIMD is not defined. So it does seem like a legit warning in some cases.

@byroot byroot merged commit a3645a1 into ruby:master Jun 30, 2025
70 checks passed
@nobu
Copy link
Copy Markdown
Member

nobu commented Jul 1, 2025

That warning is due to simd/conf.rb was required and evaluated only once, as described at #819.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants