From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=ho600j0e; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id C60105A004C for ; Wed, 06 Nov 2024 21:47:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730926048; bh=6ZCKgE5XOR5Dylj2IWtToSOgv+1FafjKuMGscGE3aq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ho600j0eJTagMvU0Y+LsmmL/SZE0lEGr8eHi0mhofURU2FX0vEHweHW52HrwNvfof CyloKzu7Q2kQvLxR/FXhirCBU2JNdCYuPYLh2RFeLKLqZvLbIbnzmqYnf2BzHBi/+1 7L/t3ikQxiavZCFNgjbQq85SRMlGvtcbQjTEh04Csq1dsmtEZeDL8jMFsny+0ld2tZ aBOt/ms/vMBjifRZSh+BX05nDFR+98XX502/tHFbgxziD6PPFSQ0CDTSjTXLOmUJk+ 2HFlCURBdVV98gc6ivYnV4RGJCOZPPRFcLV3NX/3CkEi30Pey78SdekzMchUDkGbso 4bxoVI0IQDgaA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XkHMN5BJhz4x8f; Thu, 7 Nov 2024 07:47:28 +1100 (AEDT) Date: Thu, 7 Nov 2024 07:47:20 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 00/12] Minor fixups for or inspired by clangd and related tools Message-ID: References: <20241105232528.1408144-1-david@gibson.dropbear.id.au> <20241106201329.67440249@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sKDaC/nnIwDQAl8q" Content-Disposition: inline In-Reply-To: <20241106201329.67440249@elisabeth> Message-ID-Hash: LTGYGIMTRSMWXZGBGMQ2AGX6NTRM3Q5X X-Message-ID-Hash: LTGYGIMTRSMWXZGBGMQ2AGX6NTRM3Q5X 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 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: --sKDaC/nnIwDQAl8q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 06, 2024 at 08:13:29PM +0100, Stefano Brivio wrote: > On Wed, 6 Nov 2024 10:25:16 +1100 > David Gibson wrote: >=20 > > I've been experimenting with Zed and clangd recently. Currently it > > generates an enormous number of largely spurious errors and warnings > > on the passt code base. Mostly that's due to its default > > configurations not suiting us. This series adds some configuration > > that addresses a number of those warnings, though there remain many > > more for now. > >=20 > > Some of the warnings also look reasonable, so I have a grab bag of > > fixes or workarounds for some of those two. >=20 > This looks good to me. I tested build and functionality on Alpine x86, > Debian armhf testing, Debian i686 testing, Debian amd64 testing, Fedora > Rawhide x86 with this series plus: >=20 > - [PATCH] fwd: Squash different-signedness comparison warning > - [PATCH 0/8] Avoid running cppcheck on system headers >=20 > on top. >=20 > Other than single comments about "[PATCH 0/8] Avoid running cppcheck on > system headers", the only issue this series adds is, with clang-tidy 16 > (current version on Debian testing), a rain of: >=20 > /home/sbrivio/passt/.clang-tidy:3:5: error: unexpected scalar > - "clang-diagnostic-*,clang-analyzer-*,*,-modernize-*" > ^ >=20 > but it's fine, using clang-tidy 18 (on armhf) and clang-tidy 19 > (everywhere else) fixes that. I thought this might just because I was mixing a string with a list of options with a json/yaml list of options. Alas, no, I think clang-tidy 16 only accepts a big string here rather than a yaml list. Doing it as a string would prevent the interspersing of the explanatory comments, so I don't think it's worth it. > There are a bunch of pre-existing cppcheck and clang-tidy warnings that > remain after this, and I plan to deal with them: Ok. Do you need anything from me? [snip] > cppcheck 2.16 on 32-bit only (!): >=20 > -- > dhcpv6.c:334:14: style: The comparison 'ia_type =3D=3D 3' is always true.= [knownConditionTrueFalse] > if (ia_type =3D=3D OPT_IA_NA) { > ^ > dhcpv6.c:306:12: note: 'ia_type' is assigned value '3' here. > ia_type =3D OPT_IA_NA; > ^ > dhcpv6.c:334:14: note: The comparison 'ia_type =3D=3D 3' is always true. > if (ia_type =3D=3D OPT_IA_NA) { > ^ Weird, looks like another false positive, maybe with the same cause as that other knownConditionTrueFalse thing we hit. > -- >=20 > 3. clang-tidy 19.1.2 on Alpine x86: >=20 > -- > /home/sbrivio/passt/log.c:216:3: error: misleading indentation: statement= is indented too deeply [readability-misleading-indentation,-warnings-as-er= rors] > 216 | logfile_rotate_move(fd, now); > | ^ I think my FALLOC_FL_COLLAPSE_RANGE change should fix this as a side effect - the odd indentation is because of the #ifdef cutting off part ofthe if. --=20 David Gibson (he or they) | 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 --sKDaC/nnIwDQAl8q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmcr1bQACgkQzQJF27ox 2GeIBRAAkcHTIJdsexh4qWoPk+acCNbiqIbW0EvCFJoBfhAMKIzDqAO1VI36L1DG x3NJaacNgNboqAPGy4RTvgg9NqTp6pVhqB3CYGipunlJrr70YZxCojYUTo3UH0J6 KQzKn8hsFBmu92lWxg7rAszc7PPeC1HAXJW81hMn1Ou/c0Y6e6dMEMCtHuWvbzFM xDrW2dJ/i5yPHL06ePY/+0M5wcXe22Lg72IhoUSmKGvaUwFx9Vxxx2x/b5KSSlgC Q4wZmDzT0uyHhqmRKhQJBawghJTHFPnqqjSZ9pcBJl6Djz5yAqVSKTdqmS35XwVf yoe5DXNHQHDaoqgfZIzvwMuwRRAyZZtLTg14a9cRFqwRpq2wQL3X3wkmcW0Sp2Mt 6NqBsNZukzHwfS4wGGFZ3iOlsTy+NYEYEyXoLSdbHgjJ6MEFG/vkh0cJA8vNkfK2 24ijVvHnvWwD8JBtlNtQhXg4ZvlwAZLIuKeIobyrBJ0JbfOWeohBMCYI76mdTVFm dlHjQran/cyptb6yXscl5Q6tqJ9mzN7xRig2gGjHu55eZE2mmcfUc2A4ys7eTMIV qRrgzt/iTl9MGfessP2aUmIZ2avZHzo5D2qdRWupv60k5cmE3aCgvlN3u2iTU4pn zINjKWyQXV47YPrKgGQsvrAE9bRTDDBQUwFTU+RacJTIx9BA8Gc= =7fhH -----END PGP SIGNATURE----- --sKDaC/nnIwDQAl8q--