Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Weird syscall returns Message-ID: <6109@brl-smoke.ARPA> Date: Sun, 12-Jul-87 16:44:52 EDT Article-I.D.: brl-smok.6109 Posted: Sun Jul 12 16:44:52 1987 Date-Received: Mon, 13-Jul-87 04:51:37 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <428@sds.SciCom.MN.ORG> <23189@sun.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 There are several UNIX library routines in various implementations that attempt to return a -1 value for a function whose return type is (char *). This is a holdover from the PDP-11 days where it didn't matter, but these days we encounter environments for which there is simply no such thing as (char *)-1. I would hope that all these botches could be fixed (certainly in any proposed standards!). One could do this in two phases: Phase 1 -- change all applications and library code that invokes such functions to check for either -1 or NULL instead of just -1; Phase 2 -- change these functions to return NULL (of the appropriate type) on failure. There have been similar phased transitions before; we should get this fixed before it gets worse.