Missing const qualifier on syntax parameter of onig_new_without_alloc.
peterhuene opened this issue · 2 comments
peterhuene commented
The current (6.1.1) prototype for onig_new_without_alloc
function is:
int onig_new_without_alloc(OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo);
Note that the syntax
argument is missing a const
qualifier.
As a result, in C++, we're unable to directly use the ONIG_SYNTAX_...
macros as an argument because they ultimately use declarations of ONIG_EXTERN const OnigSyntaxType OnigSyntax...;
and the const-qualifier cannot be cast away without a const_cast
in C++.
peterhuene commented
Thanks!
k-takata commented
Thank you for the report.