Skip to content

Commit

Permalink
Merge pull request #311 from dag-erling/format-nonliteral
Browse files Browse the repository at this point in the history
Mark onig_snprintf_with_pattern() as printf()-like
  • Loading branch information
kkos authored Oct 4, 2024
2 parents 2da403b + 02e5761 commit 3e5120d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/regint.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
#endif
#endif

#ifndef ONIG_PRINTFLIKE
#if defined(__clang__) || defined(__GNUC__)
#define ONIG_PRINTFLIKE(x, y) __attribute__((format(printf, x, y)))
#else
#define ONIG_PRINTFLIKE(x, y)
#endif
#endif

/* config */
/* spec. config */
#define USE_REGSET
Expand Down Expand Up @@ -945,7 +953,7 @@ struct re_pattern_buffer {
extern void onig_add_end_call(void (*func)(void));
extern void onig_warning(const char* s);
extern UChar* onig_error_code_to_format P_((int code));
extern void ONIG_VARIADIC_FUNC_ATTR onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
extern void ONIG_VARIADIC_FUNC_ATTR ONIG_PRINTFLIKE(6, 7) onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));
extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, void* /* CClassNode* */ cc));
extern RegexExt* onig_get_regex_ext(regex_t* reg);
Expand Down

0 comments on commit 3e5120d

Please sign in to comment.