From owner-svn-src-head@FreeBSD.ORG Mon Nov 14 19:04:24 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CEC106564A; Mon, 14 Nov 2011 19:04:24 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id A0BAC8FC1A; Mon, 14 Nov 2011 19:04:23 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pAEJ4Ls5033696 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 14 Nov 2011 19:04:22 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20111114180235.GA58284@zim.MIT.EDU> Date: Mon, 14 Nov 2011 19:04:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <3B8C1412-E18D-47E3-A09D-4847DD078963@FreeBSD.org> References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> <4EC0E6C2.4010509@FreeBSD.org> <20111114180235.GA58284@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Dimitry Andric , src-committers@FreeBSD.org Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:04:24 -0000 On 14 Nov 2011, at 18:02, David Schultz wrote: > On Mon, Nov 14, 2011, Dimitry Andric wrote: >> On 2011-11-14 09:21, Stefan Farfeleder wrote: >>> On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: >>>> Author: theraven >>>> Date: Sun Nov 13 16:18:48 2011 >>>> New Revision: 227487 >>>> URL: http://svn.freebsd.org/changeset/base/227487 >>>>=20 >>>> Log: >>>> The spec says that FILE must be defined in wchar.h, but it wasn't. = It >>>> is now. Also hide some macros in C++ mode that will break C++ >>>> namespaced calls. >>>>=20 >>>> Approved by: dim (mentor) >>>=20 >>> I think this change is wrong. Whic spec are you referring to? C99 >>> defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is = used >>> as parameter type for functions but that does not mean it is = exported to >>> user space. >>=20 >> http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html >=20 > It's a niggling detail, but that's an extension to the C standard, > so properly speaking, it belongs in an > #if __POSIX_VISIBLE >=3D 200809 || XSI_VISIBLE > (or something like that). The formals were struct __sFILE * > instead of FILE * for that reason -- see r103177. >=20 > P.S. You're looking at a very old version of POSIX. Check out: > http://pubs.opengroup.org/onlinepubs/9699919799/ The C99 and C1x specifications both seem to require stdio.h to be = included before wchar.h. I think this therefore places including = wchar.h and not stdio.h in the category of undefined (or, at least, not = defined) behaviour, so we are free to do anything in this case. I would = say that accepting the code and working as the programmer expected is = the least harmful thing to do here. This is what Darwin libc does = (actually, it #includes stdio.h in wchar.h). =20 David=