Skip to content

Commit 8ef8360

Browse files
authored
Merge pull request #57 from sue445/doc-variable-length-arguments
Write doc
2 parents 5e1cf0b + b1fdf26 commit 8ef8360

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Contribution Guide
22
## Add wrapper function for C
3+
### :warning: Limitation
4+
Go variable-length arguments cannot be passed directly to C functions
5+
6+
e.g. `void rb_raise(VALUE exc, const char *fmt, ...)`
7+
8+
To avoid this problem, we need to call the C function without variable-length arguments
9+
10+
See `RbRaise` implementation in [ruby-internal-error.go](ruby-internal-error.go) for details
11+
312
### 1. Generate skeleton
413
Run `ruby _scripts/dump_ruby_c_functions.rb`
514

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ ref. https://docs.ruby-lang.org/ja/latest/function/index.html
190190
* [ ] `rb_frame_last_func`
191191
* [ ] `rb_free_generic_ivar`
192192
* [ ] `rb_frozen_class_p`
193-
* [ ] `rb_funcall`
193+
* ~~[ ] `rb_funcall`~~ Go's variable-length arguments couldn't be passed directly to C. See [CONTRIBUTING.md](CONTRIBUTING.md)
194194
* [x] `rb_funcall2`
195195
* [ ] `rb_funcall3`
196196
* [x] `rb_funcallv`

0 commit comments

Comments
 (0)