Skip to content
Snippets Groups Projects
Commit ff9efa3f authored by Florian Weimer's avatar Florian Weimer
Browse files

c: Add new -Wdeclaration-missing-parameter-type permerror

This used to be a warning, enabled by default, without its own option.

A subsequent change could improve diagnostics and provide spelling
hints for declarations like “void function (int32t);”.

gcc/c-family/

	* c.opt (Wdeclaration-missing-parameter-type): New.

gcc/c/ChangeLog:

	PR other/44209
	* c-decl.cc (grokparms): Issue permerror for
	OPT_Wdeclaration_missing_parameter_type instead of a pedwarn.

gcc/ChangeLog:

	* doc/invoke.texi (Warning Options): Document
	-Wdeclaration-missing-parameter-type.

gcc/testsuite/ChangeLog:

	* gcc.dg/permerror-default.c (missing_parameter_type):
	Expect error.
	* gcc.dg/permerror-fpermissive.c (missing_parameter_type):
	Expect -Wdeclaration-missing-parameter-type warning.
	* gcc.dg/permerror-gnu89-nopermissive.c (missing_parameter_type):
	Expect -Wdeclaration-missing-parameter-type error.
	* gcc.dg/permerror-gnu89-pedantic.c (missing_parameter_type):
	Likewise.
	* gcc.dg/permerror-gnu89.c (missing_parameter_type):
	Expect -Wdeclaration-missing-parameter-type warning.
	* gcc.dg/permerror-noerror.c: Add
	-Wno-error=declaration-missing-parameter-type to build flags.
	(missing_parameter_type): Expect
	-Wdeclaration-missing-parameter-type warning.
	* gcc.dg/permerror-nowarning.c: Build with
	-Wno-declaration-missing-parameter-type.  Remove previously
	expected warning.
	* gcc.dg/permerror-fpermissive-nowarning.c: Likewise.
	* gcc.dg/permerror-pedantic.c (missing_parameter_type):
	Expect -Wdeclaration-missing-parameter-type error.
	* gcc.dg/permerror-system.c (missing_parameter_type):
	Likewise.
parent 9715c545
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment