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=HN8pAFBP; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 41D5C5A0623 for ; Fri, 08 Nov 2024 03:53:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1731034409; bh=6m19rFgGa1W1QYp+i5CyvCdafed90FVFuGUOCInF/tk=; h=From:To:Cc:Subject:Date:From; b=HN8pAFBPy1skxGbbUl6J26EPPzjEYVHmxk2sgQmwp95Bi5cOZEaRXyRCIboXrZYcR eSgtdkEMnTg0y6zmDo+V6FEk0J65JeyqIRNJHyv5ixG+qoDqsPQhWTAOksPt9n7jUF HRQTjqZaE5S817HeBTeldWdebnEUtcWB0fL/K6TPQmZ2ga130E79LK3cF7OlG3EbUF qJIqdVgLQru2iY7kvcCiLvOa6TzsnvaIeRl7lxUOyqugHxtPKe4tjVDZPQvI8nVOfp cv/xJyQsXziDrNW2qIquz1UNoXjNdYcYSArFHOgpB5wSXKyOgaX1Gp7q6tX9oxmeIv u0W6N26Vf46Iw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Xl3RF3QMPz4x6n; Fri, 8 Nov 2024 13:53:29 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 0/4] Avoid running cppcheck on system headers Date: Fri, 8 Nov 2024 13:53:26 +1100 Message-ID: <20241108025330.3161314-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: YSB7AINVFVKY5W5MVT2RSNH4DCAIHSEN X-Message-ID-Hash: YSB7AINVFVKY5W5MVT2RSNH4DCAIHSEN 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: David Gibson 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: It turns out cppcheck has inbuilt knowledge of the C library, and isn't typically given the system headers. Avoiding doing so reduces the runtime to less than half of what it currently is. For non-obvious reasons, this change also exposes some new warnings. Some are real, one is a cppcheck bug. Fix and/or workaround these then make the change to the cppcheck options. This is based on my earlier series with clangd configuration and fixes. v2: * Dropped patches already merged * Rebased on Stefano's series of lint fixes * Add a missing #include in 1/4 and 2/4 * Adjust 3/4 not to die if close_range() is unavailable David Gibson (4): log: Only check for FALLOC_FL_COLLAPSE_RANGE availability at runtime linux_dep: Move close_range() conditional handling to linux_dep.h linux_dep: Fix CLOSE_RANGE_UNSHARE availability handling cppcheck: Don't check the system headers Makefile | 15 +-------------- linux_dep.h | 22 ++++++++++++++++++++++ log.c | 10 ++-------- util.c | 17 +++++++++++++++-- util.h | 19 ------------------- 5 files changed, 40 insertions(+), 43 deletions(-) -- 2.47.0