This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15891] New: Mis-matched calling convention on function pointers accepted without error
- From: "avi at exanet dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2004 12:16:45 -0000
- Subject: [Bug c/15891] New: Mis-matched calling convention on function pointers accepted without error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC allows a regparm function to be converted into a non-regparm function
pointer. This is obviously wrong.
__attribute__((regparm(3)))
int f(int x) { return x+1; }
int (*p)(int x) = f; // ERROR
In C++, member function pointers should have similar checks.
--
Summary: Mis-matched calling convention on function pointers
accepted without error
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: avi at exanet dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15891