diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-06-15 18:18:30 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-06-16 23:49:36 +0200 |
| commit | 46048603c0cbf4899323447e72720e550a684599 (patch) | |
| tree | c27985ba510cc46ab33b1b367b9635dde00014ce | |
| parent | 96c4a9db57118e4dccb6489bf93ed763ca3f18a5 (diff) | |
| download | passt-46048603c0cbf4899323447e72720e550a684599.tar passt-46048603c0cbf4899323447e72720e550a684599.tar.gz passt-46048603c0cbf4899323447e72720e550a684599.tar.bz2 passt-46048603c0cbf4899323447e72720e550a684599.tar.lz passt-46048603c0cbf4899323447e72720e550a684599.tar.xz passt-46048603c0cbf4899323447e72720e550a684599.tar.zst passt-46048603c0cbf4899323447e72720e550a684599.zip | |
cppcheck: Add workaround for cppcheck bug 14847
It seems the function pointer argument confuses cppcheck 2.21.0 (at least),
causing it to think do_clone()'s definition has different argument names
than it's declaration, even though that's not the case. I made a minimal
reproducer and filed a cppcheck bug for this (see link). In the meanwhile
work around it with an explicit suppression.
Link: https://trac.cppcheck.net/ticket/14847
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | util.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -713,8 +713,10 @@ int __clone2(int (*fn)(void *), void *stack_base, size_t stack_size, int flags, * * Return: thread ID of child, -1 on failure */ -int do_clone(int (*fn)(void *), char *stack_area, size_t stack_size, int flags, - void *arg) +int do_clone(int (*fn)(void *), +/* false positive, see https://trac.cppcheck.net/ticket/14847 */ +/* cppcheck-suppress [funcArgNamesDifferentUnnamed,unmatchedSuppression] */ + char *stack_area, size_t stack_size, int flags, void *arg) { #ifdef __ia64__ return __clone2(fn, stack_area + stack_size / 2, stack_size / 2, |
