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 -- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/4230 You are receiving this because you are subscribed to this thread. Message ID: <geany/geany/pull/[email protected]>
