This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15052] gcc frontend accepts mismatched function declaration/defintion
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2004 00:00:55 -0000
- Subject: [Bug c/15052] gcc frontend accepts mismatched function declaration/defintion
- References: <20040421182423.15052.tjruwase@stanfordalumni.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-22 00:00 -------
Subject: Bug 15052
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jsm28@gcc.gnu.org 2004-07-22 00:00:47
Modified files:
gcc : ChangeLog c-decl.c c-typeck.c
gcc/doc : invoke.texi
gcc/testsuite : ChangeLog
gcc/testsuite/gcc.dg: noreturn-5.c qual-return-1.c
qual-return-2.c
Added files:
gcc/testsuite/gcc.dg: qual-return-3.c qual-return-4.c
Log message:
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.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4629&r2=2.4630
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.534&r2=1.535
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.345&r2=1.346
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&r1=1.490&r2=1.491
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4033&r2=1.4034
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/qual-return-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/qual-return-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noreturn-5.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/qual-return-1.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/qual-return-2.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15052