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 1w2uIZ-000ie0-0p for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 17:03:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2uIY-00CebK-0I for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 17:03:10 +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 1w2uIX-00CebB-2c for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 17:03:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2uIU-00000000ONt-1yYh for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 17:03:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 62IH33jF784254; Wed, 18 Mar 2026 13:03:03 -0400 From: Tom Lane To: Nazir Bilal Yavuz cc: Peter Eisentraut , Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Subject: Re: Enable -Wstrict-prototypes and -Wold-style-definition by default In-reply-to: References: <44885d54-0376-46b3-b574-59e0e3098580@eisentraut.org> Comments: In-reply-to Nazir Bilal Yavuz message dated "Wed, 18 Mar 2026 18:50:20 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <784252.1773853383.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Mar 2026 13:03:03 -0400 Message-ID: <784253.1773853383@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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=E2=80=99t a prototype [-Wstrict-protot= ypes] > 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. 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? regards, tom lane