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

db@rtsffm.com db@rtsffm.com
Mon Jul 2 04:36:00 GMT 2001


>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:



More information about the Gcc-prs mailing list