From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Mf6Q2O0i; dkim-atps=neutral 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 3EF715A061A for ; Thu, 07 Nov 2024 08:03:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730963015; 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=NE10HoDZ076HukUN9o+pfwzHJCr4QVeYzLrk7XX0czM=; b=Mf6Q2O0iXZKLwbfv3YfADlrY1NqKfPsrTpyHHVpSjUG4cB0aNhOJRDJXImm/Fx31xkrI9p A9kVX/Kne8YVNLbbKLT5Q0DDNYmj8EQzlrUOr8GSMxSk8JJm9zIr2L1yxuJ78OAD5xqaWT 8rkOZd5H/2o4o/bwVuH95nApTz8BArM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-151-5WMwNogsPHq0mPWWOc8YBQ-1; Thu, 07 Nov 2024 02:03:33 -0500 X-MC-Unique: 5WMwNogsPHq0mPWWOc8YBQ-1 X-Mimecast-MFC-AGG-ID: 5WMwNogsPHq0mPWWOc8YBQ Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4314a22ed8bso4575415e9.1 for ; Wed, 06 Nov 2024 23:03:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730963011; x=1731567811; 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=NE10HoDZ076HukUN9o+pfwzHJCr4QVeYzLrk7XX0czM=; b=OLMd76OQRJ7DCjV929iD/XOfqQrMphTl9Z+X8dC+cBySgiF20UdvApFKaj0Sq+hpgx 3E4WY/XZYQmDWmc7enYaGq82XkxNKgMfsz8IAEzHk1wWsTj5oXGj5rdabOHFAmBAx76G f3WnXZ08h2I83zlHhByFN/zZ+6tiqhBcQU8cV7EfMdK820Op2l0rox270bKdC/Hv1bfu hx1g97jE/n63hjbMesEeA1UIDFT8Ihl+kRY/neBbt3ifmy9YR6lG/ZCMusV/BN2DvsWs hRLpWZC/HF4vThuzFTo/at70BgbwpO4uKCtRuVmfmyUY4EEVe/n+RrhPmwi4Wx5NPQJ/ v9sg== X-Gm-Message-State: AOJu0YztkM3DI4uEA4oojzHgbnCm208E2ElJ9M8Lh5lD65J23rO9ZAjO PcfSDu7m7ndyCX1J190Xkfm1ImNvnQgepJoPh7weEK5nEAY8fyA/bgLmJ0uHZl3/hLav+7vFmfY DXiYb3MfcnCk0tartvOBFB5TH9BX41cB2TG9iPP2Uc2se0ell5g3jmW6Gzg== X-Received: by 2002:a05:600c:35d0:b0:431:5aea:964 with SMTP id 5b1f17b1804b1-432b3015d27mr1562385e9.19.1730963011301; Wed, 06 Nov 2024 23:03:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHU31OrXJDPWk3GERZLpRn0Rd8riJQ+/CTnghpfow56SPeE4xX2zJxbzd+HXQCBqGGaWoHhMQ== X-Received: by 2002:a05:600c:35d0:b0:431:5aea:964 with SMTP id 5b1f17b1804b1-432b3015d27mr1562065e9.19.1730963010777; Wed, 06 Nov 2024 23:03:30 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa5b5e8dsm51745255e9.6.2024.11.06.23.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 23:03:29 -0800 (PST) Date: Thu, 7 Nov 2024 08:03:28 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 00/12] Minor fixups for or inspired by clangd and related tools Message-ID: <20241107080328.76cd6da4@elisabeth> In-Reply-To: References: <20241105232528.1408144-1-david@gibson.dropbear.id.au> <20241106201329.67440249@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-MFC-PROC-ID: Bex1W19KuzgiHI16Q4xEpp2CIDnyOqEKbo0Hli1iMXU_1730963012 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: A2NK2C7IYBPTSELI3W44IGT3ID32CBJZ X-Message-ID-Hash: A2NK2C7IYBPTSELI3W44IGT3ID32CBJZ 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, 7 Nov 2024 07:47:20 +1100 David Gibson wrote: > 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: > > > > > 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. > > > > > > Some of the warnings also look reasonable, so I have a grab bag of > > > fixes or workarounds for some of those two. > > > > 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: > > > > - [PATCH] fwd: Squash different-signedness comparison warning > > - [PATCH 0/8] Avoid running cppcheck on system headers > > > > on top. > > > > 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: > > > > /home/sbrivio/passt/.clang-tidy:3:5: error: unexpected scalar > > - "clang-diagnostic-*,clang-analyzer-*,*,-modernize-*" > > ^ > > > > 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? No, no, thanks, I think I already figured out most of those. > [snip] > > cppcheck 2.16 on 32-bit only (!): > > > > -- > > dhcpv6.c:334:14: style: The comparison 'ia_type == 3' is always true. [knownConditionTrueFalse] > > if (ia_type == OPT_IA_NA) { > > ^ > > dhcpv6.c:306:12: note: 'ia_type' is assigned value '3' here. > > ia_type = OPT_IA_NA; > > ^ > > dhcpv6.c:334:14: note: The comparison 'ia_type == 3' is always true. > > if (ia_type == OPT_IA_NA) { > > ^ > > Weird, looks like another false positive, maybe with the same cause as > that other knownConditionTrueFalse thing we hit. It could be a similar cause, but the fact that it only happens on armhf and i686 makes me think it's not really the same. > > -- > > > > 3. clang-tidy 19.1.2 on Alpine x86: > > > > -- > > /home/sbrivio/passt/log.c:216:3: error: misleading indentation: statement is indented too deeply [readability-misleading-indentation,-warnings-as-errors] > > 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. Oops, sorry, this actually goes away with the second series. -- Stefano