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

fix: missing argument names in rb_prohibit_copy (build failure on older GCC/Clang) #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flfymoss
Copy link

The argument variable names of rb_prohibit_copy introduced in #98 are missing.
This is C23-style function declarations (N2480), so it causes build failures on older versions of GCC <= 10 (and Clang <= 10) 1 with the following error:

compiling main.c
compiling skippable_frame.c
compiling streaming_compress.c
compiling streaming_decompress.c
compiling zstdruby.c
zstdruby.c: In function ‘rb_prohibit_copy’:
zstdruby.c:277:31: error: parameter name omitted
  277 | static VALUE rb_prohibit_copy(VALUE, VALUE)
      |                               ^~~~~
zstdruby.c:277:38: error: parameter name omitted
  277 | static VALUE rb_prohibit_copy(VALUE, VALUE)
      |                                      ^~~~~
make: *** [Makefile:248: zstdruby.o] Error 1

make failed, exit code 2

Although this error does not occur on recent versions of GCC/Clang, it may cause build failures in slightly older environments.
This PR fixes the function declaration by explicitly specifying the argument variable names to maintain compatibility.

Footnotes

  1. https://en.cppreference.com/w/c/23

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.

1 participant