Skip to content
Snippets Groups Projects
Commit e508a019 authored by Joseph Myers's avatar Joseph Myers Committed by Joseph Myers
Browse files

re PR c/15052 (gcc frontend accepts mismatched function declaration/defintion)

	PR c/15052
	* c-decl.c (grokdeclarator): Only pedwarn for qualified void
	return type on function definitions.  Move other warnings for
	qualified return type to -Wreturn-type.  Do not condition any such
	warnings on -pedantic.  Update comments.
	(start_function): Only copy function type from previous prototype
	declaration if return types are compatible.
	* c-typeck.c (function_types_compatible_p): Don't condition
	warning for incompatibility of volatile qualifiers on the return
	type on -pedantic.  Update comment.
	* doc/invoke.texi (-Wreturn-type, -Wextra): Update.

testsuite:
	* gcc.dg/noreturn-5.c: Test qualifiers on function type instead of
	on return type.
	* gcc.dg/qual-return-1.c: Use -Wreturn-type.  Update expected
	messages.
	* gcc.dg/qual-return-2.c: Update expected messages.
	* gcc.dg/qual-return-3.c, gcc.dg/qual-return-4.c: New tests.

From-SVN: r85024
parent 3ea8cd06
No related branches found
No related tags found
Loading
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