Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!adam.pika.mit.edu!scs From: scs@adam.pika.mit.edu (Steve Summit) Newsgroups: comp.std.c Subject: Re: What is the domain of strerror()? Message-ID: <10446@bloom-beacon.MIT.EDU> Date: 9 Apr 89 03:16:06 GMT References: <1249@microsoft.UUCP> <9997@smoke.BRL.MIL> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: scs@adam.pika.mit.edu (Steve Summit) Lines: 16 In article <9997@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >That's easy; anything the standard says is an error number is allowed, >and anything else is up to the implementation. I.e. the non-zero value >of errno, as set by some functions according to the standard, is an >acceptable "error number" for strerror(). So if a weird number is somehow passed to strerror, the result is undefined? This seems like asking for trouble, particularly when it's easy enough to use sprintf(tmpbuf, "Error %d", errno); as many implementations do. Having the result be implementation- defined wouldn't be too bad if it meant that the text might be different ("Error" vs. "error," perhaps) but I'd rather it not do the equivalent of sys_errlist[-123] and dump core. Steve Summit scs@adam.pika.mit.edu