Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 2010 15:55:38 -0400 (EDT)
From:      Garrett Wollman <wollman@hergotha.csail.mit.edu>
To:        des@des.no
Cc:        current@freebsd.org
Subject:   Re: [CFT] BSDL iconv in base system
Message-ID:  <201006181955.o5IJtcVY095611@hergotha.csail.mit.edu>
In-Reply-To: <86bpba7nc1.fsf@ds4.des.no>
References:  <4C16C5B5.1070308@FreeBSD.org> <20100616190416.GA3896@a91-153-117-195.elisa-laajakaista.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006181955.o5IJtcVY095611>