From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 518E56130; Sun, 21 Sep 2025 16:13:18 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id AFE7361A4; Sun, 21 Sep 2025 16:13:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) by atuin.qyliss.net (Postfix) with ESMTPS id 8361661A2 for ; Sun, 21 Sep 2025 16:13:14 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 2CE6B1D0006D; Sun, 21 Sep 2025 12:13:13 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 21 Sep 2025 12:13:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1758471193; x=1758557593; bh=uyi0NbXVId Xt4O/UFfUBDOTsu/pGL+nuwNB+ijApc4A=; b=UhgLzRY9C1tcd0his5NCIoclsS 7RXo1EwJV3yIrBUZKm2e3aJ+P2Fh0zyK/eBPab8Ys7tV77zqYff1ANPUgUJVwjOp KO4AhxxwsjIV3VbhPpng8EhDb/QY5TcfUkZ68czH3cFj1ym7kToF0j3rDVEonOCd cfZrJZSFm1s/xFKQU0iBCT94fs80mPbnJDvm5/WO5aYjc//pCVyYrq1YUk/tLBhO wxv8hlnb0OPV7l0LPnzQKE+yXZJftYfu3qnNQuXDA6vnA4eSGl8P3LlpRbY0qHyl ssjmZkPyBPfqZY6t33Q7iPsWA3ff9AKI40Tyr1jUXzUcsxyHDQqqzy2INyfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758471193; x=1758557593; bh=uyi0NbXVIdXt4O/UFfUBDOTsu/pGL+nuwNB +ijApc4A=; b=CLhXuGDbFisgCJmJWzCdnZp0KjDS9DS6WzpiOKtlIJxJqzO5XIL yXxeKo3q0C00/efnix3lh2EYS8pQ3s+cwB39JNNYnmwZhh34/mS8qKwuDsy3sv5y +WtSRgdOYlmYGqwn5iXLbdSKFbzZEKg9dqk+YqvZ8CtNndBVCr2b/u0BpJEmmusm 4yXDbVVxDQ8AzW248TO7qoXWC2cUwhiqTNLcLb4s4RkZCOsr344xFpzJJMac+JXW 7KboeI3uutgD7OCXc36TvrCQbcqmRdJfwTfE/xKGrvLjAuz4xYhHEX1dOqo+No7h izIJ7RAwTisZVUw3+cY0iqAPlzMH6IJ3Ewg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehheegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 Sep 2025 12:13:12 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 6B81724BEA94; Sun, 21 Sep 2025 18:13:11 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH] tools/start-vmm: Add additional warning options In-Reply-To: <69d9b008-a4e6-403b-8627-5c7577154225@gmail.com> References: <20250918-more-c-warnings-1-v1-1-5fe4eaff8a30@gmail.com> <87tt0yslm3.fsf@alyssa.is> <4c1306e9-1042-4fd7-8e9b-e6f341950021@gmail.com> <87frcguquf.fsf@alyssa.is> <69d9b008-a4e6-403b-8627-5c7577154225@gmail.com> Date: Sun, 21 Sep 2025 18:13:10 +0200 Message-ID: <87tt0v4wdl.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: 5VLOD3AZT35FYBQ6UPCL25UPM2M7ONPM X-Message-ID-Hash: 5VLOD3AZT35FYBQ6UPCL25UPM2M7ONPM X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 9/21/25 04:55, Alyssa Ross wrote: >> Demi Marie Obenour writes: >>=20 >>> On 9/19/25 07:55, Alyssa Ross wrote: >>>> Demi Marie Obenour writes: >>>> >>>>> This detected a missing prototype. >>>>> >>>>> No functional change. >>>>> >>>>> Signed-off-by: Demi Marie Obenour >>>>> --- >>>>> tools/meson.build | 2 ++ >>>>> tools/start-vmm/ch.h | 1 + >>>>> 2 files changed, 3 insertions(+) >>>>> >>>>> diff --git a/tools/meson.build b/tools/meson.build >>>>> index 9cebd03e323531fca7600cacf120161a98de16c5..8262f3e01d7bd56561306= d7dd4650a22ca40ebe7 100644 >>>>> --- a/tools/meson.build >>>>> +++ b/tools/meson.build >>>>> @@ -9,6 +9,8 @@ project('spectrum-tools', 'c', >>>>> }) >>>>>=20=20 >>>>> add_project_arguments('-Wno-error=3Dattributes', language : 'c') >>>>> +add_project_arguments('-Werror=3Dmissing-prototypes', language : 'c') >>>>> +add_project_arguments('-Werror=3Dmissing-declarations', language : '= c') >>>>>=20=20 >>>>> if get_option('host') >>>>> add_languages('rust') >>>>> diff --git a/tools/start-vmm/ch.h b/tools/start-vmm/ch.h >>>>> index 7230913ef0abf41a4f712ac4a543c7f7fdecec0f..5431365e6e2894cdebae2= 2a9a44e2ccf1222e0d2 100644 >>>>> --- a/tools/start-vmm/ch.h >>>>> +++ b/tools/start-vmm/ch.h >>>>> @@ -8,3 +8,4 @@ struct net_config { >>>>> char id[18]; >>>>> uint8_t mac[6]; >>>>> }; >>>>> +struct net_config net_setup(const char name[static 1], int name_len); >>>> >>>> Why do we need to declare this in a C header? It's only used from Rus= t. >>> >>> Ideally the Rust declarations would be generated from the C ones >>> using bindgen. Also, this catches genuine bugs on the C side. >>=20 >> What bugs? Implicit definitions are already disallowed, aren't they? > > Function declared in one file, defined in another file with different > prototype. This makes it undefined behavior to call. I don't see how this really enforces that? Fundamentally the problem there is conflicting prototypes, not missing ones. If you had another compilation unit that didn't include the header with the prototype, and instead make its own declaration, you'd still have the same problem. If we have a norm of not declaring functions outside of the header file that corresponds to and is included by the implementation file, that prevents that from happening regardless of whether we have these errors, assuming that the compiler would still catch the prototype not matching the implementation. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaNAkFgAKCRBbRZGEIw/w ops/AP9vk13RGeBOYNBoff4rt6cNOd8xc1fm6hI1bGQuXDVuPQD8DVxGtT0ZQ10C TChXmfyihrflcO/oT0URctpeN59U7QE= =ibc5 -----END PGP SIGNATURE----- --=-=-=--