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 1w2wMm-000kSc-0w for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 19:15:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2wMl-00Dfm7-0b for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 19:15:39 +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 1w2wMk-00Dflt-2T for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 19:15:38 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2wMh-00000000Peg-1p2j for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 19:15:37 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-486b96760easo2014445e9.2 for ; Wed, 18 Mar 2026 12:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773861336; x=1774466136; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ctjBYC2lhlhEZCkCbXsfNvZGegrIucK+Gk0cVwe+QgM=; b=NO0zyR/L6tI1hx2iA7WbwRtoZDeAKcpKEf6XfhD6UVw9oOJAYKN3/WU4g/JonhNs72 bdM7Ph2VnlTqE1hF7uvrh+oiC74W04vwgDqZviqEM4wS1P49mmB8fke4Ii3YJWW6Nhyi 4JunYTn0p50EPD0CS0lmvRRjSO1Co9tihT320Wt0EYH1+CdxNFBE0QlNknUKlwJSt2cT y9MAC9V2LhVdyyFpjXQpcneG6pgDvWRJuH00OzhyZNdJEpwbTJjBL0n/tv+1+Pjit5x4 VCkEAjZ/9mpwoptCGJxWy7QYrllb/QCAd0KhvG+XuBKQ++xrw5BuUnFhv7Z9i0qYI5nC 21jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773861336; x=1774466136; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ctjBYC2lhlhEZCkCbXsfNvZGegrIucK+Gk0cVwe+QgM=; b=rjFBwotkky3k6OH/hcwnWw4zrCjtCDeOpE1ZsRTArP1E0AuUbO56xNskYrJS3XFlqu avQgIlMbX7KY/gKdr1hwTa/6ZHujCxmCJAS0UtHZchgnAe/9K1ND+TijZVO+oGosSbJg ezozf+bVcT+KkazGfwynPb+VxHIARd5y3jtj9TCnGadV4hePAT4/VQCIi9dIm6qKL/LB QzADDNCrKgCWpP5K2nvRzqBgsZ/a/YT0uAn6Ncoazy6qEMwjT/z48Kn+N/Ayjj5CMixX 7EVwRbwSx1wRpXZ8JmYAgLuQujNvY+Jf/V7XXI5cYqckGj8WE3PzH/2JqpZGRpllt0KE 5F5w== X-Forwarded-Encrypted: i=1; AJvYcCUPd0eCI3OKjh4TEhd0OZz8n2MB6+JIIHwfQgtVC4qY1pcTCwqgpUbgB7S8AmhCileULTiinsXQghcrubKl@lists.postgresql.org X-Gm-Message-State: AOJu0YyxFwkK5VHP513AbfSWGShXaTh7T5tpTsHSWv15lLhKk7kgTCHY miKEsWkmhvSFpYmB5X7s28PN+KXaUfPBnRHQty5QoGKPNLbq0tZ+tr95 X-Gm-Gg: ATEYQzw14NQUVh0/B0le/8dUYRwQGvL1svJnRlMJTuhX7WNAmJz8itNCmZb/afMB1aS 4pcuJkykrGJFTW0fwq7mG+hAiO8S/K862PBRcF516TjlV0Udnz5TiTB/YgiYrOVhv/he+trTK7P dVFQ8y+hKw+QlOrPPSa6eH7cXPxAsEXPmkA9NXkhri5dzmHZD5HHIsPfjq56Sd0V18DMAEKXSLT DFQaz4MkttF6M2PrvwS7rNWcezunV0OJXShIa60+7DgWmhRGeIaL7vR734ENtqm42dNUMxvrUzX 6ANnvU0mCVTczwIvqMFwrcUbSxAGAecvDzhOt5c5hBdZCUDj1UdjkErIzs2JrKZPtLrSmOAHGhA 3KJKWtSiJk75S1YsYLG6rVJh2RzCp5VX3DuTVO3+Zvmj2dpiMqiuYldPvRMG1mmMUeyOTtQKZ8e jghkNLuju1HMW4mMDkjCflewkN+IZbwGdKtWNs8wrqPJorZhoXhWlBRPWHeA0iOHfNCOgAmiyos c2wkfKTMfIBZx+aUCbZBrF8dWcHHVCv92pqp63lY5VhJJyYK/4ddAud0PWFb0MLoIab X-Received: by 2002:a05:600c:4fcb:b0:485:3f38:3de3 with SMTP id 5b1f17b1804b1-486f44384d4mr78074565e9.3.1773861335405; Wed, 18 Mar 2026 12:15:35 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486f4ba760esm24444075e9.24.2026.03.18.12.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 12:15:34 -0700 (PDT) Date: Wed, 18 Mar 2026 19:15:33 +0000 From: Bertrand Drouvot To: Tom Lane Cc: Nazir Bilal Yavuz , Peter Eisentraut , 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: multipart/mixed; boundary="kE1qhMB7tHROlKew" 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 --kE1qhMB7tHROlKew Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, On Wed, Mar 18, 2026 at 01:03:03PM -0400, Tom Lane wrote: > Nazir Bilal Yavuz writes: > > I got this warning while running headerscheck after this commit: Thanks for the report! > > ~/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); Oh right, confirmed with: " $ gcc -E -I src/interfaces/ecpg/include -I src/include -I src/interfaces/libpq \ -include src/include/postgres_fe.h src/interfaces/ecpg/ecpglib/ecpglib_extern.h \ | grep ECPGget_sqlca $ struct sqlca_t *ECPGget_sqlca(void); $ void ecpg_init_sqlca(struct sqlca_t *(*ECPGget_sqlca())); " > Kinda surprising that that's not a syntax error. Yeah... > 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? I'd vote for #1 too, done in the attached. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --kE1qhMB7tHROlKew Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-Fix-Wstrict-prototypes-warning-in-ecpg_init_sqlca.patch"