re PR c/15052 (gcc frontend accepts mismatched function declaration/defintion)
authorJoseph Myers <jsm@polyomino.org.uk>
Thu, 22 Jul 2004 00:00:47 +0000 (01:00 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Thu, 22 Jul 2004 00:00:47 +0000 (01:00 +0100)
commite508a0190bcea40145bd040532cdcce39cd22fcb
tree1ac4fa272ceee88b2f67fe94a86bf5a4e1fb5d60
parent3ea8cd06555c64a073fcc4a1aed9e2083b8e2262
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
gcc/ChangeLog
gcc/c-decl.c
gcc/c-typeck.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noreturn-5.c
gcc/testsuite/gcc.dg/qual-return-1.c
gcc/testsuite/gcc.dg/qual-return-2.c
gcc/testsuite/gcc.dg/qual-return-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/qual-return-4.c [new file with mode: 0644]