ruby / ruby/resolv

win 3.1 CI failure: error: passing argument 3 of 'rb_define_private_method' from incompatible pointer type [-Wincompatible-pointer-types]

Open
#92 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
56
Forks
41
Avg merge
2h 38m
Merged PRs (30d)
7

Description

This issue is about the Windows extension, which had this failure, in a build in #91 - here's the output

win32 ../../../../ext/win32/resolv/extconf.rb
checking for GetNetworkParams() in -liphlpapi... yes
creating Makefile
make.exe
generating resolv-x64-mingw-ucrt.def
compiling ../../../../ext/win32/resolv/resolv.c
../../../../ext/win32/resolv/resolv.c: In function 'InitVM_resolv':
../../../../ext/win32/resolv/resolv.c:60:60: error: passing argument 3 of 'rb_define_private_method' from incompatible pointer type [-Wincompatible-pointer-types]
60 | rb_define_private_method(singl, "get_dns_server_list", get_dns_server_list, 0);
| ^~~~~~~~~~~~~~~~~~~
| |
| VALUE ()(VALUE) {aka long long unsigned int ()(long long unsigned int)}
In file included from C:/hostedtoolcache/windows/Ruby/3.1.7/x64/include/ruby-3.1.0/ruby/internal/anyargs.h:76,
from C:/hostedtoolcache/windows/Ruby/3.1.7/x64/include/ruby-3.1.0/ruby/ruby.h:26,
from C:/hostedtoolcache/windows/Ruby/3.1.7/x64/include/ruby-3.1.0/ruby.h:38,
from ../../../../ext/win32/resolv/resolv.c:1:
C:/hostedtoolcache/windows/Ruby/3.1.7/x64/include/ruby-3.1.0/ruby/internal/intern/class.h:340:69: note: expected 'VALUE ()(void)' {aka 'long long unsigned int ()(void)'} but argument is of type 'VALUE ()(VALUE)' {aka 'long long unsigned int ()(long long unsigned int)'}
340 | void rb_define_private_method(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
| ~~~~~~~~^~~~~~~~~~~~~~
../../../../ext/win32/resolv/resolv.c:25:1: note: 'get_dns_server_list' declared here
25 | get_dns_server_list(VALUE self)
| ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:254: resolv.o] Error 1
rake aborted!
Command failed with status (2): [make.exe]
D:/a/resolv/resolv/vendor/bundle/ruby/3.1.0/bundler/gems/ruby-core-tasks-81412ef540dc/lib/ruby-core/make.rb:20:in []' D:/a/resolv/resolv/vendor/bundle/ruby/3.1.0/bundler/gems/ruby-core-tasks-81412ef540dc/lib/ruby-core/extensiontask.rb:54:in block in define_extconf_task'
D:/a/resolv/resolv/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => test => compile => .build/3.1.7/x64-mingw-ucrt/win32/win32/resolv.so
(See full trace by running task with --trace)
mkdir -p .build/3.1.7/x64-mingw-ucrt/win32
Error: Process completed with exit code 1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ext/win32/resolv/resolv.c, especially the get_dns_server_list declaration near line 25 and its registration near line 60. Reproduce the Windows extension build or inspect the reported compiler diagnostic, then confirm that the Windows CI compilation completes successfully without the incompatible-pointer-type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.