Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Oct 2010 16:48:38 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: standards/151316: lib/libc/string/strerror.c r1.9 breaks POSIX
Message-ID:  <20101015144838.GB56014@stack.nl>
In-Reply-To: <20101009130850.GY2392@deviant.kiev.zoral.com.ua>
References:  <201010091240.o99Ce7AM048178@freefall.freebsd.org> <20101009130850.GY2392@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 09, 2010 at 04:08:50PM +0300, Kostik Belousov wrote:
> The often-used idiom is
> 	printf("Error %d %s\n", errno, strerror(errno));
> In case of errno == 0 you get
> 	Error 0: Unknown error
> or something else depending on the order of evaluation of the arguments.

But if that wrong usage is to be fully supported, strerror() should not
fail at all. This option is mentioned in POSIX.1-2008's rationale
section for strerror().

This is only sidely related to 0 being a valid input to strerror() or
not.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101015144838.GB56014>