Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.sources.bugs Subject: Re: efopen.c Message-ID: <2109@brl-tgr.ARPA> Date: Sun, 13-Oct-85 20:21:39 EDT Article-I.D.: brl-tgr.2109 Posted: Sun Oct 13 20:21:39 1985 Date-Received: Tue, 15-Oct-85 05:08:58 EDT References: <1741@watdcsu.UUCP> Distribution: net Organization: Ballistic Research Lab Lines: 38 > /* Open a file, aborting on failure */ > > /* Written by Bernie Roehl, June 1985 */ > > #include > #include ^^^^^ NONSTANDARD INCLUDE FILE ^^^^^ > > efopen(fn, mode) ^^^^^ WRONG RESULT TYPE; should be (FILE *) ^^^^^ > char *fn, *mode; > { > FILE *unit; > if ((unit = fopen(fn, mode)) == NULL) > error("Cannot open file %s", fn); ^^^^^ IMPLICITLY DECLARES error() AN (int)-VALUED FUNCTION ^^^^^ > else > return unit; > } > > extern char *progname; ^^^^^ NONSTANDARD GLOBAL DATUM; this package should allocate it and provide a function to set it ^^^^^ > > error(s1, s2) ^^^^^ WRONG RESULT TYPE; should be (void) ^^^^^ ^^^^^ INSUFFICIENTLY GENERAL TO BE GLOBAL; should be changed to use varargs or else be made file-static ^^^^^ > char *s1, *s2; > { > fprintf(stderr, "%s: ", progname); > fprintf(stderr, s1, s2); > exit(1); ^^^^^ IMPLICITLY DECLARES exit() AN (int)-VALUED FUNCTION ^^^^^ > } Nice try, but no cigar. Please, folks, de-lint your code before posting!