From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 544DE5A004E for ; Fri, 07 Jun 2024 20:50:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717786220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TK9j/hFveM5Lyad4wp160xGyteb179vwG6dWDMkbH3I=; b=cx6mTNKRZZuR1UvGiUJNoW36NDHP3ZDAi/jrGmd7I02fiPrDFGPaI8/4+GC13DlR8nRNb+ WwnuX5JAnmFFlsWfXYmPjqxnpEfBt1v1iU1uawjUBjwKwmvk9t0LAzPo5is7+46yGJmN14 fxDzCtHyUwj7/651CZFJO8UhQJj4K28= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227-G81_HveJNwS90t2Gm6OCEg-1; Fri, 07 Jun 2024 14:50:18 -0400 X-MC-Unique: G81_HveJNwS90t2Gm6OCEg-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-44035455d1cso33005311cf.2 for ; Fri, 07 Jun 2024 11:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717786217; x=1718391017; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TK9j/hFveM5Lyad4wp160xGyteb179vwG6dWDMkbH3I=; b=lQFAYQy5h58E8pcecN1CfOhs2AUd3Fcbu6YRGZCaS3y5ydNSEcWA/7tMNsK4hHw1Oa 6qYR0ECAG3lBUVXc62RO5k2On3TTxzAjH8/4IW2XagQdFXqcrsfIOYARs9BlsMe7sWJh 1z7PeTq5rK4QAxeW5idy4m/+rU8a6ZTxcl74paQsJcbelbVeA/hQzJ371PnCRV8GAdew akvWOSomIo1zHe3K1wClHzBOnEFG5mZyNFDNugzbbqYSOgmo+wjONINTsbvx3q7+h+y3 NzwBkduMxeM538Mk7jDM1kSjGaMxS7Voz5T+2HRAdPf7Mx2WJuRag4E3F0gY00211x1l rJ9w== X-Gm-Message-State: AOJu0YwQX5WWZ1jXmmIG0sLIM/SuxlZKemBLagPIDqmrnsaj+2BJ2w8i qIQxgkfvD+J+OcZmLTM2okIoAsG2p+H9xDu53b4bOiPMtuAUeIdMPjTNIdlNSWMCVh6rXamKOjI iHQtkpKZeUorrlG9U6qWfNq7nYLbzv1AVQd5zjw46rXRmRsWbQqKunS+wS/A1 X-Received: by 2002:a05:620a:3b8d:b0:795:1d6b:6840 with SMTP id af79cd13be357-7953c31da64mr340475685a.32.1717786216827; Fri, 07 Jun 2024 11:50:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVEgZA1jDtlw6T9oXI9GhbESO4hs7PDl/UwNZrqsafYVgJLO3GzMQXvJCfiZM7naGYc7xACQ== X-Received: by 2002:a05:620a:3b8d:b0:795:1d6b:6840 with SMTP id af79cd13be357-7953c31da64mr340473685a.32.1717786216258; Fri, 07 Jun 2024 11:50:16 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id af79cd13be357-795332e1d9fsm190491885a.135.2024.06.07.11.50.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2024 11:50:15 -0700 (PDT) Date: Fri, 7 Jun 2024 20:49:40 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/9] cppcheck: Suppress constParameterCallback errors Message-ID: <20240607204940.5a1de94f@elisabeth> In-Reply-To: <20240606100949.1250958-4-david@gibson.dropbear.id.au> References: <20240606100949.1250958-1-david@gibson.dropbear.id.au> <20240606100949.1250958-4-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: YGWYKXXF4MWEWIDLN37F4NCAA2QPDCBV X-Message-ID-Hash: YGWYKXXF4MWEWIDLN37F4NCAA2QPDCBV X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 6 Jun 2024 20:09:43 +1000 David Gibson wrote: > We have several functions which are used as callbacks for NS_CALL() which > only read their void * parameter, they don't write it. The new > 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 > that error from cppcheck. > > Signed-off-by: David Gibson > --- > Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/Makefile b/Makefile > index 8ea17576..22f05813 100644 > --- a/Makefile > +++ b/Makefile > @@ -314,5 +314,6 @@ cppcheck: $(SRCS) $(HEADERS) > $(SYSTEM_INCLUDES:%=--suppress=unmatchedSuppression:%/*) \ > --inline-suppr \ > --suppress=unusedStructMember \ > + --suppress=constParameterCallback \ On versions before 2.14, this now raises an unmatchedSuppression... I'm not sure how to deal with this. Should we give up and just add a --suppress=unmatchedSuppression for all the source files? I can't think of anything better at the moment. I applied the rest of the series, just not this patch. -- Stefano