From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4331A5A005E for ; Fri, 17 Feb 2023 10:43:48 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PJ6ML23zpz4x8N; Fri, 17 Feb 2023 20:43:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1676627022; bh=dd/WqXAitwckgT3rWO4+GXM5GMPksn4nL6r2BLiBBEk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p+ZpAXDf0LvGv4yFQAw4fwU3ozQWfFr0V78rsf9lOLDwt/FCqiJUXmBjW+dFqSegL CVwGmlvuoJeEgVys1PKIIgEe615ec2uL+swqPe4aTu25UvvntL8hxKhW8etVAjVzbX K1AS1BIDcFgPfej8ZFfVcrWVZtuXhza/4eweK+YU= Date: Fri, 17 Feb 2023 20:10:48 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] conf, tap: Silence two false positive invalidFunctionArg from cppcheck Message-ID: References: <20230216182210.2290008-1-sbrivio@redhat.com> <20230217090453.419bb4f9@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5B0dHpQhYrrkzDDz" Content-Disposition: inline In-Reply-To: <20230217090453.419bb4f9@elisabeth> Message-ID-Hash: IOZRFJAMXZNNBNXMRCEYA4NO35VPWODG X-Message-ID-Hash: IOZRFJAMXZNNBNXMRCEYA4NO35VPWODG X-MailFrom: dgibson@gandalf.ozlabs.org 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, Laine Stump X-Mailman-Version: 3.3.3 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: --5B0dHpQhYrrkzDDz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 17, 2023 at 09:04:53AM +0100, Stefano Brivio wrote: > On Fri, 17 Feb 2023 09:53:28 +1100 > David Gibson wrote: >=20 > > On Thu, Feb 16, 2023 at 07:22:10PM +0100, Stefano Brivio wrote: > > > The newly introduced die() calls exit(), but cppcheck doesn't see it > > > and warns about possibly invalid arguments used after the check which > > > triggers die(). Add return statements to silence the warnings. > > >=20 > > > Signed-off-by: Stefano Brivio =20 > >=20 > > Oof, that's super ugly. Any chance that cppcheck will recognize the > > ((noreturn)) attribute if we added it to die()? >=20 > It doesn't. I guess Library::isnoreturn() in lib/library.cpp is fooled > by the way we build die with a macro. I couldn't find a corresponding > ticket, there's a vaguely related false _negative_ here: > https://trac.cppcheck.net/ticket/7933 >=20 > but I admit I might have missed one from this list: > https://trac.cppcheck.net/query?status=3D!closed&keywords=3D~valueflow >=20 > I see a few alternatives: >=20 > - move exit() after the function body, instead of using 'doexit', I > couldn't find a "nice" way to do so but it should be possible I prefer this option - I don't love flags which dramatically change behaviour any way. > - fix the issue in cppcheck >=20 > - or... would you prefer if I use a cppcheck-suppress token here? >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --5B0dHpQhYrrkzDDz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmPvRHsACgkQzQJF27ox 2Gdjxw//bmdmdLnlWH/39ibKjKsxz9D/Kd9rgxyaTQjgYWvX/C9B+W4BPA1K2QJ4 8gyhQj14aRGThZYBHNfAbZFB4ZMC26H5gwcraEvDtQuhurqJToZK1wjpFH9go3yu xq5RGlzgdhP1p+2qTpd36IdlMF/SyVIL3SxschOUMy6/4F/DFd7Hwm9atMBM08TG qos4rx83/kyx15mN5/iJGH4SudPxTGVTcfIWBmHnJUOAEwOAw3vXACH7bXCA23p7 Ne+nHC2Dv7ww0EV6LNt959JSWS6OUbUipMH3fw05h8UiqBcZmUi9RM1YqjfV4gJT +vbGGs2tOS4GrVFlf/toq2AbtwWetf+Sq4NCHWNSIlD+WJp/I4+1Yz8Br2U9NUuM cKO7zWTB1Hv3Vbc4jQCfQHrzaLmb+qHyIDHGJqVlq30qEh2EvzVXgY2ib/v6aflP GXFRnDtvjUWDgdQEl+q9wN1e6YKLrX4/fEnAbTJRwJUvXCN/I9awsF+XVAJAq8o4 Fqs2FMe6F/2FM6BUPTp9A8x2F34BnNovi2hFQeUjtx5wSV7koR0YMfnD5PV0jb1G oiWLRJNcStxCNYhUsejy8QsH+GUi+m//QlVJ0kD2E8vEW/vs0JCOKu9Rwj0eUn3o A0g4flwX06vUmObVnG9hU/c0+mbu0H3BonRVLRDCvRni2VSUcCo= =o2eO -----END PGP SIGNATURE----- --5B0dHpQhYrrkzDDz--