From owner-freebsd-current@FreeBSD.ORG Thu Jun 21 19:44:58 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9D94106567D for ; Thu, 21 Jun 2012 19:44:58 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (wollman-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:ccb::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8C89A8FC12 for ; Thu, 21 Jun 2012 19:44:58 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.5/8.14.5) with ESMTP id q5LJivbt053022; Thu, 21 Jun 2012 15:44:57 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.5/8.14.4/Submit) id q5LJivlo053021; Thu, 21 Jun 2012 15:44:57 -0400 (EDT) (envelope-from wollman) Date: Thu, 21 Jun 2012 15:44:57 -0400 (EDT) From: Garrett Wollman Message-Id: <201206211944.q5LJivlo053021@hergotha.csail.mit.edu> To: demelier.david@gmail.com In-Reply-To: <4FE340FF.80406@gmail.com> References: <4FE315B6.9020102@gmail.com> Organization: none X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (hergotha.csail.mit.edu [127.0.0.1]); Thu, 21 Jun 2012 15:44:57 -0400 (EDT) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hergotha.csail.mit.edu X-Mailman-Approved-At: Thu, 21 Jun 2012 20:12:27 +0000 Cc: , current@freebsd.org Subject: Re: mbstowcs(3) may not return -1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 19:44:59 -0000 In article <4FE340FF.80406@gmail.com>, demelier.david@gmail.com writes: >On 21/06/2012 14:55, Sergey Kandaurov wrote: >> It returns (size_t)(-1). >> I don't know how is it correct, but this conforms to C spec. >Mm, if I understand well, since it is cast to size_t, I think the return >value will be SIZE_MAX - 1 then, right? No. C does not make any such equivalence. "(size_t)-1" is the one correct spelling of this value (modulo redundant additional parentheses), and that's how the standard writes it. -GAWollman