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

Cast via VALUE function pointer between object pointer #150

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

nobu
Copy link
Member

@nobu nobu commented Oct 10, 2024

With gcc 13 and -pedantic:

../../../src/ext/fiddle/function.c: In function ‘function_call’:
../../../src/ext/fiddle/function.c:374:15: error: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
  374 |     args.fn = (void(*)(void))NUM2PTR(cfunc);
      |               ^
../../../src/ext/fiddle/pointer.c: In function ‘rb_fiddle_ptr_inspect’:
../../../src/ext/fiddle/pointer.c:573:84: error: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  573 |                       RB_OBJ_CLASSNAME(self), (void *)data, data->ptr, data->size, (void *)data->free);
      |                                                                                    ^

@kou kou merged commit 6421e31 into ruby:master Oct 10, 2024
44 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 10, 2024
pointer
(ruby/fiddle#150)

With gcc 13 and -pedantic:

```
../../../src/ext/fiddle/function.c: In function ‘function_call’:
../../../src/ext/fiddle/function.c:374:15: error: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
  374 |     args.fn = (void(*)(void))NUM2PTR(cfunc);
      |               ^
../../../src/ext/fiddle/pointer.c: In function ‘rb_fiddle_ptr_inspect’:
../../../src/ext/fiddle/pointer.c:573:84: error: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
  573 |                       RB_OBJ_CLASSNAME(self), (void *)data, data->ptr, data->size, (void *)data->free);
      |                                                                                    ^
```

ruby/fiddle@6421e317a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants