distributions.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* ISO C23 removal of unprototyped functions
@ 2023-02-07 12:14 Bruno Haible
  2023-02-07 13:58 ` alice
  2023-02-08 11:02 ` A. Wilcox
  0 siblings, 2 replies; 4+ messages in thread
From: Bruno Haible @ 2023-02-07 12:14 UTC (permalink / raw)
  To: distributions

Seen in the GCC change log [1]: Joseph Myers wrote:

"
  C2x has completely removed unprototyped functions, so that () now
  means the same as (void) in both function declarations and
  definitions, where previously that change had been made for
  definitions only.  Implement this accordingly.

  This is a change where GNU/Linux distribution builders might wish to
  try builds with a -std=gnu2x default to start early on getting old
  code fixed that still has () declarations for functions taking
  arguments, in advance of GCC moving to -std=gnu2x as default maybe in
   GCC 14 or 15; I don't know how much such code is likely to be in
  current use.
"

There were two essential changes in this area in ISO C 23:
  * https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf
    1) removed the K&R C syntax for function definitions
         int foo (x, y) int x; long y; { ... }
    2) in function definitions, () is equivalent to (void).
  * https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm
    3) A function declarator with a parameter list of () declares a prototype
       for a function that takes no parameters (like it does in C++).
       See ISO C 23 § 6.7.6.3.(13).

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0a4b219d39c74ae




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-08 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 12:14 ISO C23 removal of unprototyped functions Bruno Haible
2023-02-07 13:58 ` alice
2023-02-08 11:02 ` A. Wilcox
2023-02-08 12:01   ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).