diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-09-27 19:02:45 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-27 19:02:45 +0900 |
commit | efa0c31ce518bb26aca80392cce7fc5471ca9fef (patch) | |
tree | f3360895fafdbd641ee0bcff5b19013ca58dbc19 /regparse.c | |
parent | f8000e293141a9af9f51effc76007aab21b0dede (diff) |
Add printf-style format attribute to oniguruma functions
Also make the format string compatible with literal strings which
are const arrays of "plain" chars.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4899
Merged-By: nobu <[email protected]>
Diffstat (limited to 'regparse.c')
-rw-r--r-- | regparse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/regparse.c b/regparse.c index 24ff5b9a18..3348381e23 100644 --- a/regparse.c +++ b/regparse.c @@ -2833,6 +2833,10 @@ fetch_name(OnigCodePoint start_code, UChar** src, UChar* end, #endif /* USE_NAMED_GROUP */ +#ifdef PRINTF_ARGS +PRINTF_ARGS(static void onig_syntax_warn(ScanEnv *env, const char *fmt, ...), 2, 3); +#endif + static void onig_syntax_warn(ScanEnv *env, const char *fmt, ...) { @@ -2841,7 +2845,7 @@ onig_syntax_warn(ScanEnv *env, const char *fmt, ...) va_start(args, fmt); onig_vsnprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, env->pattern, env->pattern_end, - (const UChar *)fmt, args); + fmt, args); va_end(args); #ifdef RUBY if (env->sourcefile == NULL) |