Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UTF8_CHK_SKIP: eliminate casting away const
Seen with: ./Configure -des -Dusedevel -Accflags=-Wcast-qual mathoms.c: In function ‘Perl_utf8_to_uvchr’: utf8.h:804:53: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual] 804 | (UNLIKELY(s[0] == '\0') ? 1 : my_strnlen((char *) (s), UTF8SK IP(s))) | ^ embed.h:792:87: note: in definition of macro ‘utf8_to_uvchr_buf_helper’ 792 | # define utf8_to_uvchr_buf_helper(a,b,c) Perl_utf8_to_uvchr_buf_h elper(aTHX_ a,b,c) | ^ mathoms.c:970:12: note: in expansion of macro ‘utf8_to_uvchr_buf’ 970 | return utf8_to_uvchr_buf(s, s + UTF8_CHK_SKIP(s), retlen); | ^~~~~~~~~~~~~~~~~ mathoms.c:970:37: note: in expansion of macro ‘UTF8_CHK_SKIP’ 970 | return utf8_to_uvchr_buf(s, s + UTF8_CHK_SKIP(s), retlen); | ^~~~~~~~~~~~~ mathoms.c seems to be the only user of this macro. This came up when reviewing Perl#22271
- Loading branch information