Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!xanth!mcnc!rti!bdrc!jcl From: jcl@bdrc.UUCP (John C. Lusth) Newsgroups: comp.lang.c Subject: varargs strangeness? Message-ID: <353@bdrc.UUCP> Date: 16 Dec 88 17:00:38 GMT Organization: Becton Dickinson Research Cntr, RTP, NC Lines: 33 I have a variadic function to which I pass a pointer to a function returning void. Distilled, my function looks like error (va_alist) va_dcl { va_list ap; void (*f)(); va_start(ap); f = va_arg(ap, void (*)()); . . . } It is at the assignment to f that the compiler complains "syntax error at or near symbol *" On a SUN 4, the macro call va_arg(ap, void (*)()) expands to f = (( void (*)() *)(ap += sizeof( void (*)())))[-1]; What's going wrong, how do I fix it, and why does the macro add that extra star to the cast? John C. Lusth Becton Dickinson Research Center - "designing the Ace Bandage of the future!" bdrc!jcl@mcnc