Keep clang-tidy clean for the converted modules

Once the C headers are included from C++ translation units,
bugprone-dynamic-static-initializers reports each extern variable
declaration in them; none is defined in a header, so disable the check.
Mark the two bounded memchr searches in ssurl.cpp, which
bugprone-not-null-terminated-result misreads as string copies.
This commit is contained in:
Max Lv
2026-10-14 22:51:15 +08:00
parent 96ce822c6b
commit 21c13e8ddc
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -244,12 +244,14 @@ ss_url_parse(const char *uri, ss_url_t *url)
return -1;
/* The fragment is a human-readable tag and is not part of the config. */
// NOLINTNEXTLINE(bugprone-not-null-terminated-result): memchr searches a bounded span, no string is produced
const char *hash = (const char *)memchr(body, '#', body_len);
if (hash != NULL) {
url->tag = percent_decode(hash + 1, body_len - (size_t)(hash - body) - 1);
body_len = (size_t)(hash - body);
}
// NOLINTNEXTLINE(bugprone-not-null-terminated-result): memchr searches a bounded span, no string is produced
const char *query = (const char *)memchr(body, '?', body_len);
size_t head_len = query ? (size_t)(query - body) : body_len;