Some versions of CLang warn when performing pointer arithmetic on strings, trying to avoid people thinking `+` is a string concatenation operator in C. It's kind of silly, but given we only seem to have one of those instances, just "fix" it using array syntax instead.
PS: I was about to troll the compiler using syntax `&(has_bom ? 3 : 0)[str]` instead, but I figured it's probably not gonna annoy the compiler as much as the next contributor, so I backed out. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/4230
-- Commit Summary --
* Avoid clang string-plus-int warning
-- File Changes --
M tests/test_encodings.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/4230.patch https://github.com/geany/geany/pull/4230.diff
@techee approved this pull request.
Yes, works for me, thanks.
Can be merged I think.
Merged #4230 into master.
github-comments@lists.geany.org