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]

egcs-19990913: cannot convert `int (*)(int)' to `void *' in assignment



Hi,

the following code compiles with gcc-2.95.x but egcs rejects it:

int main()
{
  int (*p1)(int)=0;
  int (*p2)(int);

  (void* &) p2=p1;
}

$ gcc convert.cc
convert.cc: In function `int main()':
convert.cc:6: cannot convert `int (*)(int)' to `void *' in assignment

$ gcc -v
Reading specs from /usr/local/egcs-19990913/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19990913 (experimental)

I know the code looks rather strange but that's what you find sometimes
in some libraries :>.

-- 
Laurent.


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