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]

c++/3527: g++ 3.0 rejects cast from function ptr to void*.



>Number:         3527
>Category:       c++
>Synopsis:       g++ 3.0 rejects cast from function ptr to void*.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 02 04:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dirk Bonekamper
>Release:        3.0
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Assigning a function ptr to a variable of type void* results in the error message:

testcast.c:2: cannot convert `int (*)()' to `void*' in initialization

>How-To-Repeat:
int f();

void *fp = f;

>Fix:
Explicit cast to void*.
>Release-Note:
>Audit-Trail:
>Unformatted:


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