aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-06-08 16:30:40 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-06-08 13:06:20 +0200
commitd949667436a2c213a25170449894b312fad62d18 (patch)
tree81178c371d768e92752901443fd562511676f0ba /tcp_splice.c
parent8a83b530feeac1a9812fe457e86257430f6b2fed (diff)
downloadpasst-d949667436a2c213a25170449894b312fad62d18.tar
passt-d949667436a2c213a25170449894b312fad62d18.tar.gz
passt-d949667436a2c213a25170449894b312fad62d18.tar.bz2
passt-d949667436a2c213a25170449894b312fad62d18.tar.lz
passt-d949667436a2c213a25170449894b312fad62d18.tar.xz
passt-d949667436a2c213a25170449894b312fad62d18.tar.zst
passt-d949667436a2c213a25170449894b312fad62d18.zip
cppcheck: Suppress constParameterCallback errors
We have several functions which are used as callbacks for NS_CALL() which only read their void * parameter, they don't write it. The constParameterCallback warning in cppcheck 2.14.1 complains that this parameter could be const void *, also pointing out that that would require casting the function pointer when used as a callback. Casting the function pointers seems substantially uglier than using a non-const void * as the parameter, especially since in each case we cast the void * to a const pointer of specific type immediately. So, suppress these errors. I think it would make logical sense to suppress this globally, but that would cause unmatchedSuppression errors on earlier cppcheck versions. So, instead individually suppress it, along with unmatchedSuppression in the relevant places. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 3f9d395..5a406c6 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -736,6 +736,7 @@ static void tcp_splice_pipe_refill(const struct ctx *c)
*
* Return: 0
*/
+/* cppcheck-suppress [constParameterCallback, unmatchedSuppression] */
static int tcp_sock_refill_ns(void *arg)
{
const struct ctx *c = (const struct ctx *)arg;