[Bug c/15891] New: Mis-matched calling convention on function pointers accepted without error
avi at exanet dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 9 12:16:00 GMT 2004
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
More information about the Gcc-bugs
mailing list