Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!purdue!umd5!trantor.umd.edu!chris From: chris@trantor.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: varargs.h vs. lint Message-ID: <2365@umd5.umd.edu> Date: 28 Feb 88 09:04:52 GMT References: <1608@byzantium.UUCP> <1632@mhres.mh.nl> <51@vsi.UUCP> <7361@brl-smoke.ARPA> <1078@pasteur.Berkeley.Edu> Sender: ris@umd5.umd.edu Reply-To: chris@trantor.umd.edu (Chris Torek) Organization: University of Maryland, College Park Lines: 39 Keywords: arguments, varargs In article <1078@pasteur.Berkeley.Edu> dheller@cory.Berkeley.EDU.UUCP (Dan Heller) writes: >I have reservations about wanting to use varargs for _all_ the arguments >passed to the function. While lint be be told not to "complain", it avoids >lint's ability to find potential mistakes in the calling routines. True enough. I have found, however, that /*VARARGSn*/ does not quite work as advertised; and the following trick enables type checking while still using varargs according to definition: #ifdef lint /* VARARGS ARGSUSED */ message(fmt) char *fmt; { } #define message _lint_message #endif lint /* VARARGS */ message(va_alist) va_dcl { va_list l; va_start(l); ... va_end(l); } #undef message This creates warnings about _lint_message being unused, but a short `grep' fixes that right up: lint ... | grep -v '_lint_.* defined.*but never used' The dpANS would suggest a name other than _lint_message; X_lint_message should be fine. -- In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163 (still on trantor.umd.edu because mimsy is not yet re-news-networked) Domain: chris@mimsy.umd.edu Path: ...!uunet!mimsy!chris