Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!trt From: trt@rti.rti.org (Thomas Truscott) Newsgroups: comp.misc Subject: Re: "Invalid null command" Summary: more portable "null" command Message-ID: <1991Apr2.162016.5724@rti.rti.org> Date: 2 Apr 91 16:20:16 GMT References: <1991Apr2.005620.11434@ico.isc.com> Organization: Research Triangle Institute, RTP, NC Lines: 41 The IEFBR14 posting is one of those pleasant surprises on Usenet, a must-have program for the thoughtful programmer's toolchest. But it included neither Makefile nor man page, was that an oversight? Alas IEFBR14.c seems to have portability problems. A proposed revision is included below. I am no language-lawyer, and am uncertain if main's value must be declared (int, or void?), or whether one must declare function arguments that are unused. But I am confident that a few more revisions will yield a marvel, a trophy even for Ritchie himself! Tom Truscott ---------------- (Revised lines preceded with '**') ** #if defined(vms) ** /* avoid VMS install-specific problems */ ** #include stdlib.h ** #include locale.h ** #else #include #include ** #endif ** /* System-specific exit status (K&R 2nd Ed, page 252) */ ** #if !defined(EXIT_SUCCESS) ** /* Should print a warning here, but cannot in ANSI C */ ** #define EXIT_SUCCESS 0 ** #endif #ifndef lint static char *sccsid = "%W% - %E%"; #endif /*ARGSUSED*/ ** main(int argc, char *argv[], char *envp[]) { setlocale(LC_ALL, ""); ** exit(EXIT_SUCCESS); ** /* NOTREACHED */ }