Subject: Re: long long vs. -ansi...
To: Mike Long <mike.long@analog.com>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 04/08/1997 11:45:55
On Apr 8, 11:41am, mike.long@analog.com (Mike Long) wrote:
-- Subject: Re: long long vs. -ansi...
| I know it's gross, but would it work to declare signal handlers like
| this?:
|
| void (*handler) __P((int, ...));
|
| You'd lose typechecking on all arguments after the first, but it does
| express all of the variants in a minimal way.
Actually it makes things worse because a varyadic function will never
match a non varyadic one:
main() {
void (*a)(int, ...);
void foo(int);
a = foo;
}
% gcc foo.c
foo.c: In function `main':
foo.c:7: warning: assignment from incompatible pointer type
% cc foo.c
"foo.c", line 7: warning: assignment type mismatch:
pointer to function(int, ...) returning void "=" pointer to function(int) returning void