style(string): satisfy clang-tidy and clang-format for final-wave gate
Suppress clang-analyzer-security buffer-handling diagnostics on the plan-mandated __builtin_memcpy word loads and bugprone swappable- parameter diagnostics on the C-standard signatures; wrap the autoconf substitution tokens in clang-format off/on (the space clang-format wants before the closing @ would break config.status substitution). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* and tails; word loads and stores go through __builtin_memcpy.
|
||||
*/
|
||||
void *
|
||||
memmove(void *dst, const void *src, size_t n)
|
||||
memmove(void *dst, const void *src, size_t n) // NOLINT(bugprone-easily-swappable-parameters)
|
||||
{
|
||||
const unsigned long word = sizeof(unsigned long);
|
||||
unsigned char *d = dst;
|
||||
@@ -29,8 +29,8 @@ memmove(void *dst, const void *src, size_t n)
|
||||
{
|
||||
unsigned long w;
|
||||
|
||||
__builtin_memcpy(&w, s, sizeof w);
|
||||
__builtin_memcpy(d, &w, sizeof w);
|
||||
__builtin_memcpy(&w, s, sizeof w); // NOLINT(clang-analyzer-security.insecureAPI.*)
|
||||
__builtin_memcpy(d, &w, sizeof w); // NOLINT(clang-analyzer-security.insecureAPI.*)
|
||||
d += word;
|
||||
s += word;
|
||||
n -= word;
|
||||
@@ -56,8 +56,8 @@ memmove(void *dst, const void *src, size_t n)
|
||||
|
||||
d -= word;
|
||||
s -= word;
|
||||
__builtin_memcpy(&w, s, sizeof w);
|
||||
__builtin_memcpy(d, &w, sizeof w);
|
||||
__builtin_memcpy(&w, s, sizeof w); // NOLINT(clang-analyzer-security.insecureAPI.*)
|
||||
__builtin_memcpy(d, &w, sizeof w); // NOLINT(clang-analyzer-security.insecureAPI.*)
|
||||
n -= word;
|
||||
}
|
||||
while (n != 0)
|
||||
|
||||
Reference in New Issue
Block a user