This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15891] New: Mis-matched calling convention on function pointers accepted without error


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]