Problem with C compiler

Erik Talvola talvola at cory.Berkeley.EDU
Sat Jun 10 04:51:05 AEST 1989


In trying to compile a program on an HP workstation here at Berkeley
(HP 9000/200 series), I ran into a problem with the C compiler.  I have
the following lines of code:

static void default_new_handler ();
void (*__new_handler)() = default_new_handler;

This gets an error that the operands of = have incompatible types.  This
is very annoying.  I can't put a cast on the right hand side, or else it
gets an error about an illegal cast.  This compiles fine on a Sun 3/50 with
the stock compiler - but not with the HP one.  Does anyone have any ideas
on how I can work around this?  I have tried several things and none of
them work.  Declarations of function pointers work, but I can assign to
them something which is a function.

Many thanks in advance...

---------------------------+
Erik Talvola               | "It's just what we need... a colossal negative 
talvola at cory.berkeley.edu  | space wedgie of great power coming right at us
..!ucbvax!cory!talvola    | at warp speed." -- Star Drek



More information about the Comp.lang.c mailing list