Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2uf9-000ixq-2S for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 17:26:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2uf7-00CvHt-22 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 17:26:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2uf7-00CvHk-16 for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 17:26:29 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2uf4-00000000ObQ-0RNM for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 17:26:28 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id F17EDEC014C; Wed, 18 Mar 2026 13:26:26 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 18 Mar 2026 13:26:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding: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=fm1; t=1773854786; x=1773941186; bh=41FAw2RyDA31uLioXpRHa51ijg/tTsWz71toAqLPTwg=; b= dBkeCdyf9hMI5PClwIiHrxXntf52i/Iw9+JzdL/XXWuwZXyM/7HmT3bdNZHz9b5/ WTtvxBip1fcM98HC8f+em3XtUwOQVntVPNFt/3sN02vbFT/xteGaVq3Dij9JRfWM GHw0hCGLwuQuGsucxb+YKfkMb4ovH5SFzhBn/QfEKWM42gG9tFlX/aISv9PzWZ7z b/6qq8rzZ220bGVQXwDbV8JVove+FuctfdOxgaC4RDoi4vtJvOP9+ok1hEt7Uzu4 EIFT5DIl54MrKFTY7FnrwXoaslTvkJJ+LJDy0LFNsqO6esvRtZG5A/lpHYaiLYym A5S6gwNk3FVcYs6I/mvsvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1773854786; x= 1773941186; bh=41FAw2RyDA31uLioXpRHa51ijg/tTsWz71toAqLPTwg=; b=w YOjUcrduOO8Y3pajvBIqXHBTr2HrhgQVAaeIcGjOQK0UrXwQ3Zq/PKvPfprHCs20 vmDVLzAeQvrVmObjUUFvOc2Ec4p5ol4FEwKLNfekdLeme+7dszsATVBHbPfwzxLK LlXYZTw9rI9NmTHc3YSxHq3cU+DZbd1oIEhbVxJbkmHtrsOAw6W7u63/UhjAqDpP 0sOloAgkzuddUe9c+w2w/nUtA0TPTjC6Cnq/RdmrSugN+r1x77B+1z/wiglH05VQ WwRxOEiz76Ar87kUD00u5DB/IfxU1ei7Gr7Mryf7Tnf8AnQYj5aPmWe0Zq/O3Fy5 EiqcP6yFugfBZftNv3t2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeftdegjedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfei gffhvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohephedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorh hgpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepsgihrghvuhiikedusehgmhgrihhlrdgtohhmpdhrtghpthhtoh epphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg pdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Mar 2026 13:26:26 -0400 (EDT) Date: Wed, 18 Mar 2026 13:26:26 -0400 From: Andres Freund To: Tom Lane Cc: Nazir Bilal Yavuz , Peter Eisentraut , Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Subject: Re: Enable -Wstrict-prototypes and -Wold-style-definition by default Message-ID: References: <44885d54-0376-46b3-b574-59e0e3098580@eisentraut.org> <784253.1773853383@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <784253.1773853383@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-03-18 13:03:03 -0400, Tom Lane wrote: > Nazir Bilal Yavuz writes: > > I got this warning while running headerscheck after this commit: > > > ~/Desktop/projects/postgres/src/interfaces/ecpg/ecpglib/ecpglib_extern.h:221:40: > > warning: function declaration isn’t a prototype [-Wstrict-prototypes] > > 221 | void ecpg_init_sqlca(struct sqlca_t *sqlca) > > Yeah, I see that too. I believe the problem is that headerscheck > doesn't cause POSTGRES_ECPG_INTERNAL to become defined, so that > what the compiler is seeing is (from sqlca.h): > > #ifndef POSTGRES_ECPG_INTERNAL > #define sqlca (*ECPGget_sqlca()) > #endif > > and then > > void ecpg_init_sqlca(struct sqlca_t *sqlca); > > Kinda surprising that that's not a syntax error. Indeed. I don't even really understand what that POSTGRES_ECPG_INTERNAL business is about. Is that really just so we can use a local "sqlca" variable in some of our own ecpglib code while code using ecpg can't do that? Please tell me it ain't so. > We could plausibly fix this either by > > (1) renaming ecpg_init_sqlca's parameter to something else; > > (2) ensuring that POSTGRES_ECPG_INTERNAL is defined. I'd be inclined > to make ecpglib_extern.h do that rather than expecting headerscheck > to know about it. > Neither of these options are beautiful, but perhaps #1 is slightly > less ugly. Any preferences? 1) seems to be the preferrable approach. It's what code using ecpg already has to do, right? Greetings, Andres Freund