From owner-freebsd-standards@FreeBSD.ORG Mon Jun 1 23:09:18 2009 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 AB22E1065673; Mon, 1 Jun 2009 23:09:18 +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 692D98FC20; Mon, 1 Jun 2009 23:09:18 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id 817CE359949; Tue, 2 Jun 2009 01:09:17 +0200 (CEST) X-Spam-DCC: dcc1: scanner01.stack.nl 1182; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 86AC7359933; Tue, 2 Jun 2009 01:09:15 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id CAE46228BC; Tue, 2 Jun 2009 01:09:02 +0200 (CEST) Date: Tue, 2 Jun 2009 01:09:02 +0200 From: Jilles Tjoelker To: Gabor Kovesdan Message-ID: <20090601230902.GA47172@stack.nl> References: <4A244D7A.9040508@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A244D7A.9040508@FreeBSD.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-standards@FreeBSD.org Subject: Re: mbstowcs() contradiction 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: Mon, 01 Jun 2009 23:09:18 -0000 On Mon, Jun 01, 2009 at 11:51:54PM +0200, Gabor Kovesdan wrote: > I've just found a contradiction in the mbstowcs() man page. It says: > "The mbstowcs() function returns ........ or -1 if an invalid multibyte > character was encountered." > It is impossible, because its return value is size_t, which is a signed > type. Looking on the online documentaton, I think it should return > (size_t)-1 on error. I've also looked at the code and I think our > implementation is standard-compliant, but could someone take another > look, please? If someone can acknowledge I'm right, I'll update the man > page. Apart from the fact that size_t is an unsigned type, that is correct. The function returns (size_t)-1 on error. On another note, the XSI extension of allowing a NULL destination pointer to find the length seems to be implemented but is not documented. The EILSEQ errno is also an XSI extension. -- Jilles Tjoelker