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]

gcc 3.0 function pointer conversion problem.


Hello All,
    I am trying to build some code that implicitly converts function pointers
into void pointers.  I dont think this is strictly legal c++, but 2.95.2
allowed it as do VC++, and the C++ compilers for Solaris, HP-UX, & AIX.
Was this feature intentionally removed, or did it just happen?  Here is an
example:

tarheels> cat x.cpp
int fun1(const int& a, const int& b, void **c) {}
void* fun2() {return fun1;}

tarheels> /tools/Lunix/bin/g++ -o /dev/null -c x.cpp
x.cpp: In function `void* fun2()':
x.cpp:2: cannot convert `int (*)(const int&, const int&, void**)' to `void*' in 
   return

Thanks,

Jim


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