Re: Enable -Wstrict-prototypes and -Wold-style-definition by default
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-03-27T07:38:45Z
Lists: pgsql-hackers
Attachments
- v3-0001-Add-warning-option-Wold-style-declaration.patch (text/plain) patch v3-0001
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?
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add warning option -Wold-style-declaration
- c73e8ee061ad 19 (unreleased) landed
-
configure: Apply -Werror=vla to C++ as well as C
- 488ab592d9ea 19 (unreleased) landed
-
Enable warning like -Wstrict-prototypes on MSVC as well
- b4a132022444 19 (unreleased) landed
-
Remove compiler warning option -Wendif-labels
- 87e1891c459e 19 (unreleased) landed
-
Disable warnings in system headers in MSVC
- bccfc73acde9 19 (unreleased) landed
-
Fix -Wstrict-prototypes warning in ecpg_init_sqlca() declaration.
- f91b8ff6af91 19 (unreleased) landed