Path: utzoo!utgpu!watserv1!watmath!att!att!emory!wuarchive!uunet!mcsun!ukc!warwick!nott-cs!christopher-robin.cs.bham.ac.uk!ptf From: ptf@cs.bham.ac.uk (Paul Flinders ) Newsgroups: comp.lang.c Subject: ANSI C prototypes Message-ID: <1005@christopher-robin.cs.bham.ac.uk> Date: 29 Oct 90 20:54:02 GMT Reply-To: ptf@uk.ac.bham.cs (Paul Flinders ) Organization: University of Birmingham, England Lines: 25 Can anbody suggest an elegant solution to the following. given the file foo.c which contains code for a module within a program, foo.h which defines prototypes for routines in foo.c and bar.c which includes foo.h I tend to include foo.h in foo.c so that the compiler will tell me if I have been foolish enough to change a routines parameters without changing foo.c (the code in foo.c is not yet cast in stone so changes are a posibility). This works fine _except_ for varargs functions eg. in foo.h: extern void ddprintf(const char *fmt, ...); BUT in foo.c: void ddprintf(va_alist) va_dcl; this causes problems. The only solution that I've thought of is to define some preprocessor token in foo.c _before_ the include of foo.h and then #ifdef the extern declaration out. This seems a little messy though. Anybody else have any solutions to this. Paul Flinders | "It is bad luck to be superstitious." FlindersPT@cs.bham.ac.uk | -- Andrew W. Mathis