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.133.124]) by passt.top (Postfix) with ESMTP id D81FF5A004F for ; Sat, 08 Jun 2024 13:49:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717847339; 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=RkjjKm6hakANH0cL+JImEmMgijoJMc6ngH7t8UwYlmc=; b=HoPIGGB+brm4A6VrjR1VLbO0U975Z31uouk6laYzmMs/4AKWddeTlRp3+BmSKBgJSdejNc tiPV2KDdOKhgiux/BR6RYPcKWek46Zxfw+LwOSfSWaNMKZOrAjkKeCnjjDz14prpZDfWZL jwm4yfTMbp+9cxRXJe1wfaheHqeS8vg= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-EVOey04PMfKkD0VOkDtFEQ-1; Sat, 08 Jun 2024 07:48:57 -0400 X-MC-Unique: EVOey04PMfKkD0VOkDtFEQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2eae76312d8so10918721fa.2 for ; Sat, 08 Jun 2024 04:48:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717847335; x=1718452135; 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=RkjjKm6hakANH0cL+JImEmMgijoJMc6ngH7t8UwYlmc=; b=RB+jD3ShqlobdqKodTFNC3LT6W576+K8wuBiB0plfGag/bmFNaYTckJjDf+iuyBeml X21cFataz+iCSuW9I9TASwr9r32eTc5jEagvfBgN/wfg+oDJNRkvB28aR8xWY8x0Ugbj N0PSOxBhlkLSGtQLvxviHI2W7G91q0C7dxqfO48yQ6qPL5x3E87e3FxpTjzbL3Z5YREK LQax7ZGGHCjumTHZp7BltQ2QbHgXg40Kfsyr1S/WB2kYa7gZYsmbUQqMmlAuBiF/NKHy yY6ZMh5Rdk1jHUe+7ZA/EKNjXUSIzlTcSbx4hRJETYAMGe5uHp4SL0x6URL76QJFc3Z+ QLDA== X-Gm-Message-State: AOJu0Yx2xevccYIWH56gtIA3qD6kqslSuTkIIFtqsLNJF0CDAg3+lKpM UPoa+MHl015cl8jcMwiVxqSO8y3m0zZ4mU05Y6ESa6t6nZbxWR6MPyOkD5nQbI4zjcyMVhIo8tS +n6MBNqZydPXr2xmLp/MzvlFvCjGfkSEdQpZ37rSadNeUOjTQjbF09jLH56zA X-Received: by 2002:a05:6512:2213:b0:52c:831d:7eb3 with SMTP id 2adb3069b0e04-52c831d93damr345482e87.18.1717847335247; Sat, 08 Jun 2024 04:48:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESJHx7mpbKmfwTivjGqzBXzw/mT2o1AHlZAhtTcxC/l7mr0gcFcAKdElqK/9FRwCHdfoUWzw== X-Received: by 2002:a05:6512:2213:b0:52c:831d:7eb3 with SMTP id 2adb3069b0e04-52c831d93damr345455e87.18.1717847334487; Sat, 08 Jun 2024 04:48:54 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52c82c37a25sm68833e87.149.2024.06.08.04.48.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2024 04:48:53 -0700 (PDT) Date: Sat, 8 Jun 2024 13:48:17 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/9] cppcheck: Suppress constParameterCallback errors Message-ID: <20240608134809.4ffb1c5e@elisabeth> In-Reply-To: References: <20240606100949.1250958-1-david@gibson.dropbear.id.au> <20240606100949.1250958-4-david@gibson.dropbear.id.au> <20240607204940.5a1de94f@elisabeth> 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: US546L7ERM7OCDLQBCOCW6Z4AJ2KTI4J X-Message-ID-Hash: US546L7ERM7OCDLQBCOCW6Z4AJ2KTI4J 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 Sat, 8 Jun 2024 16:32:22 +1000 David Gibson wrote: > On Fri, Jun 07, 2024 at 08:49:40PM +0200, Stefano Brivio wrote: > > 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. > > No, I don't think we want to do that, that's likely to leave stale > suppressions about. > > Although it logically makes sense to suppress this globally, there are > only three spots it actually occurs, so I'll rewrite to suppress in > just those places, along with a similarly local unmatchedSuppression > suppression. Oh, you're right, I instinctively thought it would be a much bigger mess, I didn't even try. > > I applied the rest of the series, just not this patch. > > Nice.. although this was the only one actually blocking other work. ...of course. :) I just applied the new patch. -- Stefano