Commit 0a4b219d authored by Joseph Myers's avatar Joseph Myers
Browse files

c: C2x removal of unprototyped functions

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.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c/
	* c-decl.cc (grokparms): Handle () in a function declaration the
	same as (void) for C2X.

gcc/testsuite/
	* gcc.dg/c11-unproto-3.c, gcc.dg/c2x-unproto-3.c,
	gcc.dg/c2x-unproto-4.c: New tests.
	* gcc.dg/c2x-old-style-definition-6.c, gcc.dg/c2x-unproto-1.c,
	gcc.dg/c2x-unproto-2.c: Update for removal of unprototyped
	functions.
parent d2694766
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment