From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27109 invoked by alias); 5 Dec 2001 22:38:35 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26907 invoked from network); 5 Dec 2001 22:38:29 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 5 Dec 2001 22:38:29 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id EAEC41E3AA; Wed, 5 Dec 2001 23:38:28 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Per Bothner Cc: gcc@gcc.gnu.org Subject: Re: misleading statement in bugs.html#known References: <3C0E8E95.20202@bothner.com> X-Yow: Why don't you ever enter any CONTESTS, Marvin?? Don't you know your own ZIPCODE? From: Andreas Schwab Date: Wed, 05 Dec 2001 14:38:00 -0000 In-Reply-To: <3C0E8E95.20202@bothner.com> (Per Bothner's message of "Wed, 05 Dec 2001 13:16:05 -0800") Message-ID: User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.1.30 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2001-12/txt/msg00243.txt.bz2 Per Bothner writes: |> The bugs.html files says 'FILE *yyin =3D stdin' "will not compile with G= NU |> libc (GNU/Linux libc6), because stdin is not a constant. This was done |> deliberately, in order for there to be no limit on the number of open FI= LE |> objects." |>=20 |> The latter has nothing to do with it. It is easy to make stdin be |> a constant while still having no limit on the number of open FILE |> objects. For example: |>=20 |> extern FILE __stdin; |> @define stdin (&__stdin) |>=20 |> The point is that glibc allows you to *assign* to stdin, so it is |> no longer constant. This is a questionable feature.. No. The real reason is that using the address of a static object is a nightmare in context of maintaining binary compatibility. Platforms that use copy relocations will lose if the size of the FILE type changes. In any way, the C standard does not *require* stdin to be a constant. Thus using it as an initializer at file scope is broken no matter what. Andreas. --=20 Andreas Schwab "And now for something Andreas.Schwab@suse.de completely different." SuSE Labs, SuSE GmbH, Schanz=E4ckerstr. 10, D-90443 N=FCrnberg Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5