Andrej Prsa <> wrote:
# Hi!
#
# Why do I get a warning about incompatible pointer type if I try to assign
# a pointer to the function with variable argument number:
#
# int func (int argc, ...) ,
#
# but everything is ok when I'm using a simple function like:
#
# int func (int argc, char *whatever)
#
# Can't I point to the function with variable number of arguments?
If you want to assign functions with various arguments, you can use a
cast or old-style functions. Doing so is, of course, less safe.
typedef void (*func)(void);
typedef void (*old)();
void a(b,c) int b,c; {;}
void w(x,y,z) double x,y,z; {;}
int p(int q,void *r) {;}
void t(void) {
func P; old Q;
P = (func)a; /*casts*/
P = (func)w;
P = (func)p;
Q = a; /*old style functions*/
Q = w;
}
--
Derk Gwen
http://derkgwen.250free.com/html/index.html
Haven't you ever heard the customer is always right?