Re: Enable -Wstrict-prototypes and -Wold-style-definition by default

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Enable -Wstrict-prototypes and -Wold-style-definition by default
Date: 2026-03-27 07:38:45
Message-ID: ff1b26a3-7f36-474a-93f1-bb9afcc7cf87@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. What do you think about the attached
patch, which reorganizes this a bit more?

Attachment Content-Type Size
v3-0001-Add-warning-option-Wold-style-declaration.patch text/plain 4.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yasuo Honda 2026-03-27 07:41:36 Re: [PATCH] Fix unexpected loss of DEFERRABLE property after toggling NOT ENFORCED / ENFORCED
Previous Message Yugo Nagata 2026-03-27 07:35:49 Re: Track skipped tables during autovacuum and autoanalyze