From owner-freebsd-standards@FreeBSD.ORG Wed Aug 12 18:50:08 2009 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D45106564A for ; Wed, 12 Aug 2009 18:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 385708FC43 for ; Wed, 12 Aug 2009 18:50:08 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CIo7HL090023 for ; Wed, 12 Aug 2009 18:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7CIo7AM090022; Wed, 12 Aug 2009 18:50:07 GMT (envelope-from gnats) Date: Wed, 12 Aug 2009 18:50:07 GMT Message-Id: <200908121850.n7CIo7AM090022@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Jilles Tjoelker Cc: Subject: Re: standards/129196: Inconsistent errno in strtol() X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jilles Tjoelker List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 18:50:08 -0000 The following reply was made to PR standards/129196; it has been noted by GNATS. From: Jilles Tjoelker To: bug-followup@FreeBSD.org, shurd@sasktel.net Cc: Subject: Re: standards/129196: Inconsistent errno in strtol() Date: Wed, 12 Aug 2009 20:45:25 +0200 The behaviour seems fine to me. POSIX.1-2008 on http://www.opengroup.org/onlinepubs/9699919799/functions/strtol.html allows errno=EINVAL if no conversion could be performed (but the proper way to check this is via endptr). Common sense suggests that strtol("0", NULL, 0) be successful and return 0, and in fact that is the case ("0" is an octal constant). "0x" should be interpreted as a subject sequence "0" followed by unrecognized sequence "x". -- Jilles Tjoelker