Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.unix-wizards,net.lang.c Subject: Re: ANSI X3J11 onexit() implementation Message-ID: <6102@elsie.UUCP> Date: Sat, 21-Jun-86 15:28:07 EDT Article-I.D.: elsie.6102 Posted: Sat Jun 21 15:28:07 1986 Date-Received: Mon, 23-Jun-86 03:14:50 EDT References: <1438@brl-smoke.ARPA> Organization: NIH-LEC, Bethesda, MD Lines: 24 Keywords: X3J11 onexit freebie Xref: linus net.unix-wizards:15499 net.lang.c:8742 Summary: a qualified second to the motion In article <1438@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn) writes: > I have just posted a public-domain implementation of the ANSI X3J11 > (draft C language standard) "onexit" function. . .I am now in a position to > criticize the interface. . .A much cleaner interface would be: > > int onexit(void (*func)(void)); > > which would return zero or not depending on whether the function > was successfully registered. I think the current awkward design is > an artifact of the original Whitesmiths, Ltd. implementation. . . Having suggested the same myself (see mod.std.c archives), I'll second the motion. . .with a qualification. Since there are existing (Whitesmiths) implementations with an interface different from that described above, it's almost surely best to use a different name for the above interface--for example, int atexit(void (*func)(void)); This avoids surprises when moving existing source code to an ANSI standard system. -- UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado@seismo.ARPA DEC, VAX, Elsie & Ado are Digital, Borden & Shakespeare trademarks.