[CFT] BSDL iconv in base system

Garrett Wollman wollman at hergotha.csail.mit.edu
Fri Jun 18 19:55:41 UTC 2010


In article <86bpba7nc1.fsf at ds4.des.no>, des at 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


More information about the freebsd-current mailing list