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

Laurent Bonnaud Laurent.Bonnaud@irisa.fr
Mon Sep 20 01:20:00 GMT 1999


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.


More information about the Gcc-bugs mailing list