1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Get rid of -Wgnu-zero-variadic-macro-arguments errors

As zero variadic macro argument, `rb_scan_args(argc, argv, "")`
(or `"0"`), means 0-arity method and should be defined so, that
case doesn't need to consider.
This commit is contained in:
Nobuyoshi Nakada 2020-05-01 14:12:12 +09:00
parent e19f4b3ac0
commit 76d9be9ce9
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -380,7 +380,7 @@ rb_scan_args_set(int kw_flag, int argc, const VALUE *argv,
argc, argvp, fmt, \
(sizeof((VALUE*[]){__VA_ARGS__})/sizeof(VALUE*)), \
((VALUE*[]){__VA_ARGS__})), \
(rb_scan_args)(argc, argvp, fmt, ## __VA_ARGS__))
(rb_scan_args)(argc, argvp, fmt, __VA_ARGS__))
# define rb_scan_args_kw(kw_flag, argc, argvp, fmt, ...) \
__builtin_choose_expr( \
__builtin_constant_p(fmt), \
@ -388,7 +388,7 @@ rb_scan_args_set(int kw_flag, int argc, const VALUE *argv,
kw_flag, argc, argvp, fmt, \
(sizeof((VALUE*[]){__VA_ARGS__})/sizeof(VALUE*)), \
((VALUE*[]){__VA_ARGS__})), \
(rb_scan_args_kw)(kw_flag, argc, argvp, fmt, ## __VA_ARGS__))
(rb_scan_args_kw)(kw_flag, argc, argvp, fmt, __VA_ARGS__ /**/))
#endif
#endif /* RUBY3_SCAN_ARGS_H */