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 1w646V-003utO-2J for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 10:07:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w646T-0097gt-1O for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 10:07:45 +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 1w646T-0097gk-0G for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 10:07:45 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w646R-00000001IZE-3NhJ for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 10:07:44 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-439b94a19fdso1812849f8f.0 for ; Fri, 27 Mar 2026 03:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774606062; x=1775210862; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/XzAVIDyAyA3YVD+7DNIypa7CjVTg4oEnyQkdNMZZsQ=; b=Mj6ndiaL/sdT5iBT/ypX4/oscXeGy9a/fqgkKhnIW4ENsAnXz7HQ2pwg7YaRqlaNTJ 46CUePEKZOZNqe0nqosxFcPK7NMzXSlzyKE6Se94Um7v63cwzP+Z4kZGDopTFE+NVSzi N73KQ2hFbgd7G7kfbFZB0bdQpNRFhxW5FJnzwHrK8FimHtuxcwZic13xZVyEw7ght6t6 RpeYdnHyw4JOhdSK036QxiuWLuzjO+Lj4st73okDKeTTjTms7YJOQXSUwGYji3s8qiSU HfZCAUrQcgrvKyf4tDiMV+6u+5P+jjKrLJpwwtN+2CpPik5emeTIMDpympEjkZnd5BvO EENQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774606062; x=1775210862; h=in-reply-to: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=/XzAVIDyAyA3YVD+7DNIypa7CjVTg4oEnyQkdNMZZsQ=; b=MxbHD5rFlEB+hveqo9R8zwrJBlUWDQh4W5YGSXKsqxqWD007cQAO3rAOV/2xJQUCAo 5ubjzE7chKWyfHAupWPwgtvepNyMcnAdfx9ErT4nc2e2FYXlSvcEKNMZT9j54e6HPvyW wD8VJIPQISL7ypRDLFq64EUhk3YzlwZwq1T/utjiTWDtigdn/T8d8FrNrL6ZRgly6d88 KdLIKBNHUaP9tDb5OB6nZqOHNc9gDClLzaVIB150NLzJ5WroIwzQb6j1ueJWu7pCBY4U l2yfwwD2AblUgTEcsv2XXmpaM6kvsjP4tGcU8hmj2W8t4IALNjEoggiINYOD5vUWGU13 Eeaw== X-Gm-Message-State: AOJu0YzjF6Qa0C2jnCvG4BG56pnJFwsR8Af3Oqb0FrQeVEW37PgbrB6Z 208yDiCtuimEC6b1ZcdXDb3zhSgHZ9NaXD6Pso+pMjGUqiYYuCGM9HDgdUNv3g== X-Gm-Gg: ATEYQzwtxqI601tFrz+amBmfnD5pvNQf9rkl6gcvUUyNDFScZw7P8boFXpWmIaUtO0R 8splMDBAFyilORn6FrzwXX0pI11VEU1/WKlED5zqhty5nIJqwX+1l4e52z9aZcp7p2NXQD3qmXW /1Cq+ExVF+s1kWT6+V3pNKFl3SH4ppVcEnWSx/tGxbLuc+ukalO3sYRdPogqDCSYQNQjG69WNWc HDMbdysCT1YPEH/VWKew72ETMZHsNNZh06aYVF8/BOcNgbBRD6eqLKdEbzMVMAUj5mRiOKgFjSU pGa0FLKG6wFITcUPkPGuHu5uM8SgfbJA85BWXdTyNaisH7R2oxc1LveV2YEaCgY3VCIM7ndLJzS /rT/48/qM3caISzvr3tvQ2AynXwZNNOpLP0zYjVU7qtS/WQ2g10QKmSTcb68fYQNtw73Hz1ZkNj y1m1tx+RvH0yZ0gi1hGvn4x48T9qh2emerGCww7cH0s9fk9C10HznzdvgxjZpIE2mRwY9ytDhoU 8JMRrPgiYoKTibkrrWfKoCfb1I4DGGCBFl2qsS7O981pUoeP+Iw12H3iA== X-Received: by 2002:a05:6000:184f:b0:43b:9060:8829 with SMTP id ffacd0b85a97d-43b9e9d8c3cmr2781804f8f.10.1774606061988; Fri, 27 Mar 2026 03:07:41 -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 ffacd0b85a97d-43b919e68a6sm16551577f8f.33.2026.03.27.03.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 03:07:41 -0700 (PDT) Date: Fri, 27 Mar 2026 10:07:40 +0000 From: Bertrand Drouvot To: Peter Eisentraut Cc: 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> <4ab608af-2f90-47d8-88a5-6329f6630fff@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Mar 27, 2026 at 08:38:45AM +0100, Peter Eisentraut wrote: > The first three patches have been committed. > > On 24.03.26 08:16, Bertrand Drouvot wrote: > > 0004: > > > > --- a/meson.build > > +++ b/meson.build > > @@ -2199,6 +2199,7 @@ unroll_loops_cflags = cc.get_supported_arguments(['-funroll-loops']) > > common_warning_flags = [ > > '-Wmissing-prototypes', > > + '-Wold-style-declaration', > > > > Nit, what about adding it with (as the comment is also accurate for the new one)? > > > > " > > # These are C-only flags, supported in all C11-capable GCC/Clang versions. > > cflags_warn += cc.get_supported_arguments(['-Wstrict-prototypes', '-Wold-style-definition']) > > " > > Yeah, makes sense to collect the C-only flags together. But now that I'm > looking at this again, the comment "supported in all C11-capable GCC/Clang > versions" is not relevant here, it was only relevant in configure.ac because > there we don't actually test for these flags but require them without > testing. Right, it was a bit misleading. > What do you think about the attached patch, which reorganizes this > a bit more? +# C-only warnings +c_warning_flags = [ + '-Wmissing-prototypes', + '-Wold-style-declaration', + '-Wold-style-definition', + '-Wstrict-prototypes', +] That looks ok but I wonder if we should also add '-Werror=vla' to it ( and remove it from common_warning_flags) to be in sync with what configure.ac is doing: " PGAC_PROG_CC_CFLAGS_OPT([-Werror=vla]) # -Wvla is not applicable for C++ " Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com