This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cannot convert `int (*)()' to `void*' in initialization - should not be an error
On Thu, May 31, 2001 at 10:18:27AM -0300, Alexandre Oliva wrote:
> They were in error. GCC 3.0 is correct. C++ doesn't allow implicit
> conversion from function types to void*.
I noticed this too (and had to add a cast). What is the reason
that C++ doesn't allow this? I don't like casts, they normally
lead to bugs later on. What is the pitfal in this case? Probably
the same as the reason that C++ forbids it.
--
Carlo Wood <carlo@alinoe.com>