Tree-walker callbacks vs -Wdeprecated-non-prototype

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Tree-walker callbacks vs -Wdeprecated-non-prototype
Date: 2022-05-01 23:41:20
Message-ID: CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

As visible on seawasp (and noticed here in passing, while hacking on
the opaque pointer changes for bleeding edge LLVM), Clang 15 now warns
by default about our use of tree walkers functions with no function
prototype, because the next revision of C (C23?) will apparently be
harmonising with C++ in interpreting f() to mean f(void), not
f(anything goes).

nodeFuncs.c:2051:17: warning: passing arguments to a function without
a prototype is deprecated in all versions of C and is not supported in
C2x [-Wdeprecated-non-prototype]
return walker(((WithCheckOption *)
node)->qual, context);

Discussion trail:

https://reviews.llvm.org/D123456
https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm

Not sure where to see the official status of N2841 (other than waiting
for the next draft to pop out), but on random/unofficial social media
I saw that it was accepted in February, and the Clang people
apparently think it's in and I also saw a rumour that bleeding edge
GCC takes this view if you run with -std=c2x (not tested by me).

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniele Varrazzo 2022-05-01 23:51:41 Re: Libpq single-row mode slowness
Previous Message Tatsuo Ishii 2022-05-01 22:17:01 Re: Accessing git.postgresql.org fails