From owner-freebsd-standards@FreeBSD.ORG Fri Oct 15 14:48:39 2010 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FC0106564A for ; Fri, 15 Oct 2010 14:48:39 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 98B9F8FC19 for ; Fri, 15 Oct 2010 14:48:39 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A39C635A84E; Fri, 15 Oct 2010 16:48:38 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 8E6CF1706A; Fri, 15 Oct 2010 16:48:38 +0200 (CEST) Date: Fri, 15 Oct 2010 16:48:38 +0200 From: Jilles Tjoelker To: Kostik Belousov Message-ID: <20101015144838.GB56014@stack.nl> References: <201010091240.o99Ce7AM048178@freefall.freebsd.org> <20101009130850.GY2392@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101009130850.GY2392@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-standards@freebsd.org Subject: Re: standards/151316: lib/libc/string/strerror.c r1.9 breaks POSIX X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 14:48:39 -0000 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