Subject: Re: BUG: stdin not a constant (fwd)
From: [email-masked] (ANAZAWA Akio)

4 Dec 1997 23:19:47 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
To: [email-masked]
Cc: [email-masked]

Hi, Fergus.

In message "Re: BUG: stdin not a constant (fwd)"
    on 97/12/05, Fergus Henderson <[email-masked]> writes:

Fergus> ANAZAWA Akio <[email-masked]> wrote:
>> Anyway, I'm worndering why Cygnus's gcc couldn't accept Peter's
>> code.  All of other portings of gcc (and others) that I can use
>> around here accepted it (gcc 2.7.0 on SPARC, 2.6.3 on FreeBSD,
>> Sun's workshop cc, VC++ 4.2 and 5.0).

Fergus> The important thing is not the version of gcc you're using,
Fergus> it's the C library you're using.  Cygwin32 uses Cygnus's
Fergus> "newlib" C library.

Fergus> Cygnus chose to build a new version of the C library (mostly
Fergus> using existing BSD-licence freeware sources), rather than
Fergus> using the probably better-quality GNU C library.  This was
Fergus> apparently for financial reasons.

This morning, I checked header files to see what's differ.

In FreeBSD 2.1.0 (yes, I'm using this old version), stdout was defined
as;

#define stdout	(&__sF[1])

In this traditional way, stdout could be treated as constant (fixed
address) and be assinable by compiler's intializer.

In the other hand, in Cygnus', stdout was defined as

// in stdio.h
#define	stdout	(_impure_ptr->_stdout)
// in sys/reent.h
extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__;

I haven't seen them so much in detail, but these staff may be
orienting to make C library into re-entrant and thread-safe.

-- 
          @___                                    [email-masked]
          c>//_  ---     Human Interface Communications Co.,Ltd.(H.I.C.)
         (_)\(_)  ---        Phone +81 3 5467 2401 / Fax +81 3 5467 2402
------------------------------------------------------------------------

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".