From owner-freebsd-current@FreeBSD.ORG Fri Jun 18 19:55:41 2010 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 61078106566B for ; Fri, 18 Jun 2010 19:55:41 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id 165098FC1C for ; Fri, 18 Jun 2010 19:55:40 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.4/8.14.4) with ESMTP id o5IJtc9j095612; Fri, 18 Jun 2010 15:55:38 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.4/8.14.4/Submit) id o5IJtcVY095611; Fri, 18 Jun 2010 15:55:38 -0400 (EDT) (envelope-from wollman) Date: Fri, 18 Jun 2010 15:55:38 -0400 (EDT) From: Garrett Wollman Message-Id: <201006181955.o5IJtcVY095611@hergotha.csail.mit.edu> To: des@des.no In-Reply-To: <86bpba7nc1.fsf@ds4.des.no> References: <4C16C5B5.1070308@FreeBSD.org> <20100616190416.GA3896@a91-153-117-195.elisa-laajakaista.fi> Organization: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hergotha.csail.mit.edu [127.0.0.1]); Fri, 18 Jun 2010 15:55:38 -0400 (EDT) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu X-Mailman-Approved-At: Fri, 18 Jun 2010 20:17:08 +0000 Cc: current@freebsd.org Subject: Re: [CFT] BSDL iconv in base system 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: Fri, 18 Jun 2010 19:55:41 -0000 In article <86bpba7nc1.fsf@ds4.des.no>, des@des.no writes: >This means you can't, say, read data from a file into a buffer and then >pass that buffer to iconv, because the buffer is not const (otherwise >you couldn't have read data into it). That seems like a pretty >fundamental flaw. But it's a fundamental flaw in the specification of C that "pointer to pointer to X" and "pointer to pointer to const X" are incompatible in this particular way (which is not required by any machine for which there exist C99 compilers). In general, the addition of "const" to C in 1989 was a bit of a botch: it isn't as strong as people expect it to be, and there are these weird corners. (Another thing the committee left out was any way to declare a "conforming" function, in which the return type has the same qualifiers as one of its arguments -- see strchr() for example.) That's water under the bridge now, of course. -GAWollman