public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3527: g++ 3.0 rejects cast from function ptr to void*.
@ 2001-07-02  4:36 db
  0 siblings, 0 replies; 3+ messages in thread
From: db @ 2001-07-02  4:36 UTC (permalink / raw)
  To: gcc-gnats

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/3527: g++ 3.0 rejects cast from function ptr to void*.
@ 2001-07-03 16:36 Gabriel Dos Reis
  0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Dos Reis @ 2001-07-03 16:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/3527; it has been noted by GNATS.

From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: db@rtsffm.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/3527: g++ 3.0 rejects cast from function ptr to void*.
Date: 04 Jul 2001 01:24:35 +0200

 db@rtsffm.com writes:
 
 | Assigning a function ptr to a variable of type void* results in the error message:
 
 As it should.  There is no implicit conversion from function pointer
 types to `void *'. 'void *' is for pointer to *object*.
 
 -- Gaby


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/3527: g++ 3.0 rejects cast from function ptr to void*.
@ 2001-07-02  5:38 aoliva
  0 siblings, 0 replies; 3+ messages in thread
From: aoliva @ 2001-07-02  5:38 UTC (permalink / raw)
  To: db, gcc-bugs, gcc-prs, nobody

Synopsis: g++ 3.0 rejects cast from function ptr to void*.

State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Mon Jul  2 05:38:12 2001
State-Changed-Why:
    Not a bug.  There's no implicit conversion from pointer-to-function to void* in C++.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3527&database=gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-03 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-02  4:36 c++/3527: g++ 3.0 rejects cast from function ptr to void* db
2001-07-02  5:38 aoliva
2001-07-03 16:36 Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).