summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-06 11:52:17 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-06 11:52:42 +0900
commit5cff9968aefe2f407731df705830888d9d61409d (patch)
treea153eb87e2d8fe7ce7385abc941c6e0d99a911fb /include
parent146cf2f444c271cb2d4be9efa04053f4d66d16e6 (diff)
Distinguish bad scan format from no argument variables
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 86d4c391ea..89e49e1306 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -2322,7 +2322,7 @@ int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
rb_scan_args0(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__))
# if HAVE_ATTRIBUTE_ERRORFUNC
ERRORFUNC(("bad scan arg format"), int rb_scan_args_bad_format(const char*));
ERRORFUNC(("variable argument length doesn't match"), int rb_scan_args_length_mismatch(const char*,int));
@@ -2502,7 +2502,7 @@ rb_scan_args_set(int argc, const VALUE *argv,
int f_var, int f_hash, int f_block,
VALUE *vars[], RB_UNUSED_VAR(char *fmt), RB_UNUSED_VAR(int varc))
# if defined(__has_attribute) && __has_attribute(diagnose_if)
- __attribute__((diagnose_if(rb_scan_args_count(fmt)==0,"bad scan arg format","error")))
+ __attribute__((diagnose_if(rb_scan_args_count(fmt)<0,"bad scan arg format","error")))
__attribute__((diagnose_if(rb_scan_args_count(fmt)!=varc,"variable argument length doesn't match","error")))
# endif
{