linux-gcc-digest          Monday, 25 January 1999      Volume 01 : Number 359

In this issue:

        Re: C++ Destructor Question
        RE: C++ Destructor Question
        Re: C++ Destructor Question
        Re: C++ Destructor Question
        Return Message
        RE: C++ Destructor Question
        Re: C++ Destructor Question
        glibc 2.0.111
        Re: C++ Destructor Question
        Re: glibc 2.0.111
        Re: C++ Destructor Question
        Re: egcs thread question.
        Re: gcc&g++(egcs1.1.1) how to find its head files and lib?
        Suscribe, Add
        A question about STL.
        overload function question.
        GCC compiler principle
        Re: GCC compiler principle

See the end of the digest for information on subscribing to the linux-gcc
or linux-gcc-digest mailing lists.

----------------------------------------------------------------------

From: Bryan Scaringe <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 10:13:58 -0500 (EST)
Subject: Re: C++ Destructor Question

> 
> 
> Being spoiled by Java's garbage collector leads me to this quick
> question again concerning constructors in C++.
> 
> If I allocate memory via "new" using a constructor
> 
> i.e.
> 
>     class Foo
>     {
>       Foo()
>         { word = new char[LENGTH + 1];  }
> 
>       ~Foo()
>         { delete word; }
>         
>         ...
>      }
> 
> When I create an object of class Foo memory will be allocated for the
> char buffer "word". Now when the object is no longer needed must I
> make an explicit call to the destructor ~Foo() to destroy the object
> and subsequently call "delete", or, is the destructor somehow called
> automatically when the object is no  longer needed,i.e.  outside of
> it's scope?

If you allocate a 'Foo' off the stack, like:

Foo myFoo;

then it will be automaticly destroyed as soon as the function
in which it was created ends (it will be destroyed automagicly).
Destruction results in the destructor (~Foo()) being called, and the
memory allocated to Foo (in this case off the stack) being released.
In short, you don't have to do anything.

HOWEVER, you need to change your destructor so that it looks like this:

{delete [] word;}

In short: if your call to new uses [], so should your call to delete.
          Notice how you don't need to put a length in the [] durring a
          delete. C++ just need to know it's an array you're deleting.
          It will deal with the length.

> 
> Even in Java there are times when it is up to you to destroy an object
> and/or free memory used for that object, depending on how the object
> is/was created and an method equivalent of a destructor is required...
> The garbage collector is not always adequate.
> 

In C/C++:

 If you created it off the stack, it will handle the cleanup.
 If you created it dynamically, (usually new/malloc()) you
   must clean it up.

> Thanks...
> 
> Sincerely,
> 
> /John <[EMAIL PROTECTED]>
> 
> 
> -- 
> email: [EMAIL PROTECTED]
> Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
> 
> There is a great alternative to war, it's called Peace.
> 

------------------------------

From: "Michael Traffanstead" <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 11:09:49 -0600
Subject: RE: C++ Destructor Question

No.  You must explictly destroy the contained object in the
destructor of the container.  

The following code has a container bar which holds foo.  bar's
constructor new's a copy of foo, but it's destructor does not
explicitly destroy that object.
 
- --[ begin code ]---

#include <stdio.h>
#include <stdlib.h>

class foo {
public:
    foo( ) { printf("constructor foo( ) called.\n"); }
   ~foo( ) { printf("destructor ~foo( ) called.\n"); }
};

class bar {
 public:
    bar( ) { printf("constructor bar( ) called.\n");
             fp = new foo( ); }

   ~bar( ) { printf("destructor ~bar( ) called.\n"); }

   foo* fp;
};

void main( ) {
   bar *bp;

   bp = new bar();

   delete bp;
}

- --[ end code ]---

- --[ begin output ]--
constructor bar( ) called.
constructor foo( ) called.
destructor ~bar( ) called.
- --[ end output ]--

If the destructor were autmatically called, then you would see
"destructor ~foo( ) called." in the output.  You must explictly
destroy objects you create.  You can get around this by using
the auto_ptr class which will destroy pointers when the auto_ptr
object goes out of scope.

traff

( this was with egcs-1.1.1 patched up to pgcc-2.91.60 )

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Suresh
> Sent: Thursday, January 21, 1999 6:03 AM
> To: holotko
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: C++ Destructor Question
> 
> 
> Hi,
> The destructor is automatically called when the
> object in question is no longer needed. Such as
> an object is created inside a function locally and
> when the function returns the object gets killed with
> the destructor executed. Hence we dont call the 
> destructor explicitly.
> 
> And in java I feel the garbage collection concept is
> implemented quite strong and rarely do we use explicit
> deallocation.
> 
> Cheers,
> Suresh 
> Wipro-Nortel Networks
> Bangalore
> >
> >
> >Being spoiled by Java's garbage collector leads me to this quick
> >question again concerning constructors in C++.
> >
> >If I allocate memory via "new" using a constructor
> >
> >i.e.
> >
> >    class Foo
> >    {
> >      Foo()
> >        { word = new char[LENGTH + 1];  }
> >
> >      ~Foo()
> >        { delete word; }
> >        
> >        ...
> >     }
> >
> >When I create an object of class Foo memory will be allocated for the
> >char buffer "word". Now when the object is no longer needed must I
> >make an explicit call to the destructor ~Foo() to destroy the object
> >and subsequently call "delete", or, is the destructor somehow called
> >automatically when the object is no  longer needed,i.e.  outside of
> >it's scope?
> >
> >Even in Java there are times when it is up to you to destroy an object
> >and/or free memory used for that object, depending on how the object
> >is/was created and an method equivalent of a destructor is required...
> >The garbage collector is not always adequate.
> >
> >Thanks...
> >
> >Sincerely,
> >
> >/John <[EMAIL PROTECTED]>
> >
> >
> >-- 
> >email: [EMAIL PROTECTED]
> >Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
> >
> >There is a great alternative to war, it's called Peace.
> >
> 
> 
> --
> 

------------------------------

From: [EMAIL PROTECTED] (Zygo Blaxell)
Date: 21 Jan 1999 12:49:11 -0500
Subject: Re: C++ Destructor Question

In article <>,
holotko  <[EMAIL PROTECTED]> wrote:
>Being spoiled by Java's garbage collector leads me to this quick
>question again concerning constructors in C++.
>
>If I allocate memory via "new" using a constructor
>
>i.e.
>
>    class Foo
>    {
>      Foo()
>        { word = new char[LENGTH + 1];  }
>
>      ~Foo()
>        { delete word; }
>        
>        ...
>     }
>
>When I create an object of class Foo memory will be allocated for the
>char buffer "word". Now when the object is no longer needed must I
>make an explicit call to the destructor ~Foo() to destroy the object
>and subsequently call "delete", or, is the destructor somehow called
>automatically when the object is no  longer needed,i.e.  outside of
>it's scope?
>
>Even in Java there are times when it is up to you to destroy an object
>and/or free memory used for that object, depending on how the object
>is/was created and an method equivalent of a destructor is required...
>The garbage collector is not always adequate.

You need to destroy the object when you have allocated it on the heap.
You need to do the reference counting yourself (or use a reference
class that does it automatically). 

class* Foo foop = new Foo;

// blah blah blah

delete foop;

You don't call ~Foo explicitly but you do explicitly destroy the object.

- -- 
Zygo Blaxell                         (with a name like that, who needs a nick?)
Linux Engineer                          (my favorite official job title so far)
Corel Corporation      (whose opinions sometimes differ from those shown above)
[EMAIL PROTECTED]                                  (also [EMAIL PROTECTED])

------------------------------

From: Adam Wiggins <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 10:53:20 -0800 (PST)
Subject: Re: C++ Destructor Question

> If I allocate memory via "new" using a constructor
> 
> i.e.
> 
>     class Foo
>     {
>       Foo()
>         { word = new char[LENGTH + 1];  }
> 
>       ~Foo()
>         { delete word; }
>         
>         ...
>      }
> 
> When I create an object of class Foo memory will be allocated for the
> char buffer "word". Now when the object is no longer needed must I
> make an explicit call to the destructor ~Foo() to destroy the object
> and subsequently call "delete", or, is the destructor somehow called
> automatically when the object is no  longer needed,i.e.  outside of
> it's scope?

There are two situations.  One is that the value is created on the
stack inside a function call.  Global variables are similar except that
they don't get deleted until main() terminates.  Thus, you can do:


void my_func()
{
  Foo foo;

  /* do some stuff here */

} /* Foo gets deallocated */


Upon reaching the close bracket of the function, foo gets deleted
automatically, and any relevant destructors are called.

This is true of *any* pair of brackets; they don't have to be
a function.  For example:

void my_func(bool do_it)
{
  if (do_it)
  {
    Foo foo;
    /* some stuff */
  } /* foo gets deallocated */

  /* foo is _not_ valid here */
}

This is what is called "scoping".  The scope of foo in the function above
is the interior of the if (do_it) block of code.  In the other example,
the scope is the body of my_func.

Now, if you allocate a Foo on the *heap* (that is, with the 'new' keyword),
you have to keep track of the memory yourself.  You're already doing this
within the Foo class; it has a character array called "word" which it
explicitly allocates space for, and then explictly deallocates when the
object gets destoryed.

In the exact same way, any Foo's created with 'new' need to be explictly
tracked.  For example:


void my_func()
{
  Foo *foo = new Foo;

  /* code */

  delete foo;

} /* Foo is NOT automatically deallocated here */

This can, of course, easily lead to memory "leaks" where space is allocated
but no pointer is kept to the location.

Foo *my_func()
{
  return new Foo;
}

void other_func()
{
  my_func();
}

If other_func() gets called, it's a memory leak.  No one is keeping track
of the allocated Foo object, and it is now in your program's memory space
with no way to address it.




------------------------------

From: "ORAPOST" <[EMAIL PROTECTED]>
Date: 21 Jan 99 22:09:21 +0100
Subject: Return Message

- --=_ORCL_10518737_0_0
Content-Transfer-Encoding:quoted-printable
Content-Type:text/plain; charset="iso-8859-1"

The included message could not be delivered to the following invalid mail
names.  Please verify these names and try them again.

Bad name:  raulher

- --=_ORCL_10518737_0_0
Content-Type:message/rfc822

Date: 21 Jan 99 22:09:12
From:[EMAIL PROTECTED]
To:[EMAIL PROTECTED]
Subject:linux-gcc-digest V1 #358
Reply-to:BSN.PERSEUS:[EMAIL PROTECTED] 
Return-Path:<[EMAIL PROTECTED]>
Received:from listserv.funet.fi by santandersupernet.com (8.8.8+Sun/SMI-SVR4) id 
WAA14906; Thu, 21 Jan 1999 22:08:43 +0100 (MET)
Received:from vger.rutgers.edu ([128.6.190.2]:15974 "EHLO vger.rutgers.edu" ident: 
"NO-IDENT-SERVICE[2]") by listserv.funet.fi with ESMTP id <14803-1859>; Thu, 21 Jan 
1999 23:08:04 +0200
Received:by vger.rutgers.edu via listexpand id <155106-8093>; Thu, 21 Jan 1999 
15:17:08 -0500
Received:by vger.rutgers.edu id <156013-8100>; Thu, 21 Jan 1999 12:42:58 -0500
Errors-To:[EMAIL PROTECTED]
Precedence: bulk
Message-Id:<>
X-Orcpt:rfc822;linux-gcc-digest-outgoing
MIME-Version: 1.0
Content-Transfer-Encoding:quoted-printable
Content-Type:text/plain; charset="iso-8859-1"


linux-gcc-digest         Thursday, 21 January 1999     Volume 01 : Number 35=
8

In this issue:

        vfork specs
        Re: vfork specs
        A new set of patches for egcs 1.1.1/linux
        Re: glibc 2.0.110
        Re: glibc 2.0.110
        Re: glibc 2.0.110
        Re: glibc 2.0.110
        Re: vfork specs
        Re: glibc 2.0.110
        Re: glibc 2.0.110
        Re: glibc 2.0.110
        gcc&g++(egcs1.1.1) how to find its head files and lib?
        A question about the version number of glib-c?
        Re: A question about the version number of glib-c?
        Re: vfork specs
        Re: vfork specs
        gcc path question!
        Re: vfork specs 
        Re: gcc path question!
        Re: gcc path question!
        Re: glibc 2.0.110
        Re: gcc&g++(egcs1.1.1) how to find its head files and lib?
        Problem compiling glibc-2.0.110
        Re: Problem compiling glibc-2.0.110
        Re: A question about the version number of glib-c?
        Re: A question about the version number of glib-c?
        Help needed on pop3 client
        LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Re: LinuxThreads stack layout is not good
        Please try egcs 1.1.1 19990115/Linux.
        dynamic linker problem
        Re: dynamic linker problem
        Re: A question about the version number of glib-c?
        ldd bug
        RE: dynamic linker problem
        C++ Destructor Question
        Re: C++ Destructor Question
        Re: C++ Destructor Question
        Re: C++ Destructor Question

See the end of the digest for information on subscribing to the linux-gcc
or linux-gcc-digest mailing lists.

- ----------------------------------------------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 15 Jan 1999 09:56:28 -0800
Subject: vfork specs

Implementing the vfork syscall wrapper in the libc apparently provides
some problems.  To find a solution it's necessary to get a
specification of vfork, or at least make one up for Linux.

The problem is this: the vfork'ed process using the same VM as the
initial process.  Assume the following code for now:

      void
      bar ()
      {
        if ((pid =3D vfork ()) =3D=3D 0)
          foo (0);
        else if (pid =3D=3D -1)
          ...error...

When calling the vfork wrapper we have the following stack layout:

        ...something...
        return address bar after vfork call

Now the child returns from the vfork call and calls `foo' with the
resulting layout:

        ...something...
        0
        return address bar after foo call

May `foo' then exit and so the parent process starts and it sees the
return address 0 (zero) which was pushed as a parameter for `foo'.

This certainly is a situation we have to deal with and make sure that
the return address from the `vfork' syscall stays valid.  But this is
only have of the story.  It gets complicated if the use of the vfork
is not restricted.  Assume this:

        void
        bar ()
        {
          pid_t p =3D baz ();
          if (p =3D=3D 0)
            foo (0);
        }
        pid_t
        baz ()
        {
          return vfork ();
        }

Now the stack layout when reachine the syscall wrapper is

        ...something...
        return address bar after baz call
        return address baz after vfork call

At the time the function foo is called the stack layout is

        ...something...
        0
        return address bar after foo call

I.e., we are again f*cked.  This can of course be repeated for
arbitrary depths of function calls.


So the question is: does the vfork interface on other platforms
restricts the use of vfork to situations like the first example and
disallows the second one (or even deeper nestings)?  I think this is
what the Solaris man page says.

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: Roland McGrath <[EMAIL PROTECTED]>
Date: Fri, 15 Jan 1999 15:22:29 -0500
Subject: Re: vfork specs

All true vfork implementations in all systems have had these restrictions,
whether cleared stated by their documentation or not.  If you think about
it, the issue is inherent in the memory sharing behavior vfork is specified
to have.

- ------------------------------

From: [EMAIL PROTECTED] (H.J. Lu)
Date: Fri, 15 Jan 1999 12:55:58 -0800 (PST)
Subject: A new set of patches for egcs 1.1.1/linux

Hi,

A new set of patches for egcs 1.1.1/linux is at

ftp://ftp.yggdrasil.com/private/hjl/egcs/1.1.1/

Files are

egcs-1.1.1-arm-diff-990113.gz  egcs-1.1.1.diff.16.gz
egcs-1.1.1-mips.diff.gz        egcs-1.1.1.diff.17.gz
egcs-1.1.1-sparc.patch.gz      egcs-1.1.1.diff.18.gz
egcs-1.1.1.diff.1.gz           egcs-1.1.1.diff.19.gz
egcs-1.1.1.diff.10.gz          egcs-1.1.1.diff.20.gz
egcs-1.1.1.diff.11.gz          egcs-1.1.1.diff.3.gz
egcs-1.1.1.diff.13.gz          egcs-1.1.1.diff.4.gz
egcs-1.1.1.diff.14.gz          egcs-1.1.1.diff.5.gz
egcs-1.1.1.diff.15.gz

Please give it a try.

Thanks.


H.J.

- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 13:03:08 -0800 (PST)
Subject: Re: glibc 2.0.110

Dear all,
     I compiled glibc 2.0.110 with no error messages.
     When I installed it, it told me:

make -C manual subdir_install make[2]: Entering directory
`/linux2/people/mao/ftp/glibc-2.0.110/manual'
make[2]: *** No rule to make target `../crypt/genpass.c.texi', needed 
by `chapters.texi'.  Stop.
make[2]: Leaving directory `/linux2/people/mao/ftp/glibc-2.0.110/manual'
make[1]: *** [manual/subdir_install] Error 2
make[1]: Leaving directory `/linux2/people/mao/ftp/glibc-2.0.110'
make: *** [install] Error 2

    After that, my egcs can not used.
    At first, it told me no lib "/usr/local/lib/libc.so.6"
    When I linked libc.2.0.7.so to /usr/local/lib/libc.so.6
    It told me no /usr/local/include/stubs.h which included ny feature.h.

    Can anyone help me to make my egcs can work!

Thank you very much!


- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 15 Jan 1999 21:06:52 -0800
Subject: Re: glibc 2.0.110

Fenglou Mao <[EMAIL PROTECTED]> writes:

> make -C manual subdir_install make[2]: Entering directory
> `/linux2/people/mao/ftp/glibc-2.0.110/manual'
> make[2]: *** No rule to make target `../crypt/genpass.c.texi', needed 
> by `chapters.texi'.  Stop.

The announcement clearly said you have to get the most recent crypt
add-on.  Why do I bother writing any documentation at all?

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 13:30:47 -0800 (PST)
Subject: Re: glibc 2.0.110

Hi,

   The most recent crypt I can found is glibc-crypt-2.0.108.
   Is it right?

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



- ------------------------------

From: Kurt Wall <[EMAIL PROTECTED]>
Date: Fri, 15 Jan 1999 22:38:02 -0700
Subject: Re: glibc 2.0.110

Unnamed sources report that Ulrich Drepper said:
> Fenglou Mao <[EMAIL PROTECTED]> writes:
> 
> > make -C manual subdir_install make[2]: Entering directory
> > `/linux2/people/mao/ftp/glibc-2.0.110/manual'
> > make[2]: *** No rule to make target `../crypt/genpass.c.texi', needed 
> > by `chapters.texi'.  Stop.
> 
> The announcement clearly said you have to get the most recent crypt
> add-on.  Why do I bother writing any documentation at all?

Because some of us do RTFM and appreciate the information.

- - -- 
Kurt Wall
Informix on Linux FAQ - http://www.xmission.com/~kwall/iolfaq.html
Spanish Translation   - http://www.xmission.com/~kwall/iolfaqsp.html

- ------------------------------

From: Geoff Keating <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 17:35:10 +1100
Subject: Re: vfork specs

> Date: Fri, 15 Jan 1999 15:22:29 -0500
> From: Roland McGrath <[EMAIL PROTECTED]>
> Cc: GNU libc testers <[EMAIL PROTECTED]>,
>         VGER gcc list <[EMAIL PROTECTED]>,
>         VGER kernel list <[EMAIL PROTECTED]>
> X-Windows: some voids are better left unfilled.
> 
> All true vfork implementations in all systems have had these restrictions,
> whether cleared stated by their documentation or not.  If you think about
> it, the issue is inherent in the memory sharing behavior vfork is specifie=
d
> to have.

The Solaris manual page says:

NOTES
     The use of vfork() for any purpose except as a prelude to an
     immediate  call  to  a  function from the exec family, or to
     _exit(), is not advised.

     vfork() is unsafe in multi-thread applications.

     This function will be eliminated in a future  release.   The
     memory  sharing semantics of vfork() can be obtained through
     other mechanisms.

     To avoid a possible deadlock situation, processes  that  are
     children  in  the middle of a vfork() are never sent SIGTTOU
     or SIGTTIN signals; rather, output or ioctls are allowed and
     input attempts result in an EOF indication.

     On some systems, the implementation of  vfork()  causes  the
     parent  to inherit register values from the child.  This can
     create  problems  for  certain   optimizing   compilers   if
     <unistd.h> is not included in the source calling vfork().

The Solaris vfork() does not permit the child's computation to be
interleaved with the parent's; after vfork(), the parent cannot run
until the child exits or calls exec.  Except in multi-threaded
applications, when only the calling thread of control is suspended,
see the second paragraph from the manual page.
- - -- 
Geoffrey Keating <[EMAIL PROTECTED]>

- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 15 Jan 1999 22:45:00 -0800
Subject: Re: glibc 2.0.110

Fenglou Mao <[EMAIL PROTECTED]> writes:

>    The most recent crypt I can found is glibc-crypt-2.0.108.
>    Is it right?

No.  The announcement also said it is 2.0.109 and it also said where
to get it.

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: Geoff Keating <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 17:48:00 +1100
Subject: Re: glibc 2.0.110

> Date: Sat, 16 Jan 1999 13:03:08 -0800 (PST)
> From: Fenglou Mao <[EMAIL PROTECTED]>
> Cc: GNU libc testers <[EMAIL PROTECTED]>,
>         VGER gcc list <[EMAIL PROTECTED]>
> 
> Dear all,
>      I compiled glibc 2.0.110 with no error messages.
>      When I installed it, it told me:
> 
> make -C manual subdir_install make[2]: Entering directory
> `/linux2/people/mao/ftp/glibc-2.0.110/manual'
> make[2]: *** No rule to make target `../crypt/genpass.c.texi', needed 
> by `chapters.texi'.  Stop.
> make[2]: Leaving directory `/linux2/people/mao/ftp/glibc-2.0.110/manual'
> make[1]: *** [manual/subdir_install] Error 2
> make[1]: Leaving directory `/linux2/people/mao/ftp/glibc-2.0.110'
> make: *** [install] Error 2

Hmmm.  That's this change, probably:

        * manual/Makefile (examples): Filter out the example code from
        add-ons.

I liked it the way it was before.  Can we go back?

It's particularly difficult because manual/Makefile doesn't include
the sysdep makefiles, as far as I can see, so there's no way to insert
rules to make the examples in the crypt makefile.

>     After that, my egcs can not used.
>     At first, it told me no lib "/usr/local/lib/libc.so.6"
>     When I linked libc.2.0.7.so to /usr/local/lib/libc.so.6
>     It told me no /usr/local/include/stubs.h which included ny feature.h.
> 
>     Can anyone help me to make my egcs can work!

Well, you need to get a working libc and/or egcs from your backup
tapes or distribution CD-ROM.

I will add `make info' to the automated tester.

- - -- 
Geoffrey Keating <[EMAIL PROTECTED]>

- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 15 Jan 1999 22:57:29 -0800
Subject: Re: glibc 2.0.110

Geoff Keating <[EMAIL PROTECTED]> writes:

> Hmmm.  That's this change, probably:

It is this change.

> I liked it the way it was before.  Can we go back?

I haven't changed it without a reason.  `make dist' didn't worked.

> It's particularly difficult because manual/Makefile doesn't include
> the sysdep makefiles, as far as I can see, so there's no way to insert
> rules to make the examples in the crypt makefile.

Maybe all add-on Makefile can get a rule to create manual examples and
manual/Makefile uses these first.

Or: we simply say add-on must not have separate examples.  I don't
think this is unreasonable.

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 15:35:27 -0800 (PST)
Subject: gcc&g++(egcs1.1.1) how to find its head files and lib?

As title.

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 15:46:25 -0800 (PST)
Subject: A question about the version number of glib-c?

Dear all,
     I saw glibc-2.0.1, glibc-2.0.2, ..., glibc-2.0.5...
     But Ulrich Drepper released the newest version of glibc-2.0.110.
     I am confused, which one is the newest? 

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725




- ------------------------------

From: Andreas Jaeger <[EMAIL PROTECTED]>
Date: 16 Jan 1999 09:20:08 +0100
Subject: Re: A question about the version number of glib-c?

>>>>> Fenglou Mao writes:

 > Dear all,
 >      I saw glibc-2.0.1, glibc-2.0.2, ..., glibc-2.0.5...
 >      But Ulrich Drepper released the newest version of glibc-2.0.110.
 >      I am confused, which one is the newest? 

What is possible to misunderstand in the following sentence by Ulrich?
UD> The next and hopefully one of the very last test releases for glibc
UD> 2.1 is available at...

glibc 2.0.6 is the last officially released version, glibc 2.0.110 is
a test release of the upcoming glibc 2.1.

Andreas
- - -- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

- ------------------------------

From: Roland McGrath <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 03:44:22 -0500
Subject: Re: vfork specs

> The Solaris vfork() does not permit the child's computation to be
> interleaved with the parent's; after vfork(), the parent cannot run
> until the child exits or calls exec.  Except in multi-threaded
> applications, when only the calling thread of control is suspended,
> see the second paragraph from the manual page.

Well, exactly.  It would be incomprehensibly inane to attempt to have a
vfork that did not behave that way, because of exactly this problem.  It
had not before now entered my mind that Linux might have such a thing as a
vfork where both processes ran simultaneously in the same address space.

The restrictions I referred to are those on the child process not to unwind
stack frames because when the parent resumes later (after the child has
exec'd or exited), its stack pointer will be the same as it was and it will
attempt to unwind into the stack frames the child has clobbered.

- ------------------------------

From: Stanislav Meduna <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 10:21:06 +0100 (CET)
Subject: Re: vfork specs

> Assume this:
> 
>       void
>       bar ()
>       {
>         pid_t p =3D baz ();
>         if (p =3D=3D 0)
>           foo (0);
>       }
>       pid_t
>       baz ()
>       {
>         return vfork ();
>       }

The Single Unix Specification says:

: The vfork() function has the same effect as fork(),
: except that the behaviour is undefined if the process
: created by vfork() either modifies any data other than
: a variable of type pid_t used to store the return value
: from vfork(), or returns from the function in which
: vfork() was called, or calls any other function before
: successfully calling _exit() or one of the exec family
: of functions. 

So this one is (if I interpret it correctly)
definitly bad code.

Regards
- - -- 
                                Stano


- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 21:59:08 -0800 (PST)
Subject: gcc path question!

Dear Ulrich Drepper,
     Can you tell me how gcc(egcs1.1.1) to find the include files and
lib files?
     How the dynamic library is found?

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



- ------------------------------

From: "Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]>
Date: Sat, 16 Jan 1999 09:19:39 -0500
Subject: Re: vfork specs 

In message <[EMAIL PROTECTED]>, Stanislav Meduna 
writes:
+-----
| > Assume this:
| > 
| >     pid_t
| >     baz ()
| >     {
| >       return vfork ();
| >     }
| 
| The Single Unix Specification says:
| 
| : The vfork() function has the same effect as fork(),
| : except that the behaviour is undefined if the process
| : created by vfork() either modifies any data other than
| : a variable of type pid_t used to store the return value
| : from vfork(), or returns from the function in which
| : vfork() was called, or calls any other function before
| : successfully calling _exit() or one of the exec family
| : of functions. 
| 
| So this one is (if I interpret it correctly)
| definitly bad code.
+--->8

Yes.  Return in the child -> the parent's stack pointer is now left pointing=
 
to unknown data, because the stack is shared but the stack pointers 
(obviously) aren't.  (Unless #define vfork fork.)

vfork() is a horrible kludge.  This is why.

- - -- 
brandon s. allbery      [os/2][linux][solaris][japh]     [EMAIL PROTECTED]
system administrator         [WAY too many hats]           [EMAIL PROTECTED]
carnegie mellon / electrical and computer engineering                    KF8NH
     We are Linux. Resistance is an indication that you missed the point.



- ------------------------------

From: Andreas Jaeger <[EMAIL PROTECTED]>
Date: 16 Jan 1999 15:25:39 +0100
Subject: Re: gcc path question!

>>>>> Fenglou Mao writes:

 > Dear Ulrich Drepper,
 >      Can you tell me how gcc(egcs1.1.1) to find the include files and
 > lib files?
 >      How the dynamic library is found?
Did you read the manual of gcc?  info gcc will tell you everything you 
need to know.  Did you try to call gcc with the --help parameter?

Andreas
- - -- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

- ------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Sun, 17 Jan 1999 11:52:40 -0800 (PST)
Subject: Re: gcc path question!

On 16 Jan 1999, Andreas Jaeger wrote:

>  >      Can you tell me how gcc(egcs1.1.1) to find the include files and
>  > lib files?
>  >      How the dynamic library is found?
> Did you read the manual of gcc?  info gcc will tell you everything you 
> need to know.  Did you try to call gcc with the --help parameter?
> 
Perhaps you misunderstanded me, or I did not post it clearly.
What I want to know is:
     The Default include path and lib path. 
When I use old gcc.2.7.3, it worked. But when I use new egcs.1.1.1(I 
compiled before), it told me some lib error. When I use old gcc.2.7.3 
to compile egcs.1.1.1 again, the stage1 passed, but when
stage1/xgcc compile itself, it told me: 

./gencheck: can't resolve symbol '_dl_global_scope_end'
./gencheck: can't resolve symbol '_dl_default_scope'

And another error:
     stage1/xgcc -Bstage1/  -DIN_GCC   -DUSE_GNULIBC_1 -O2 -g -O2  
- - -DHAVE_CONFIG_H -I. -I../../gcc -I../../gcc/config -c ../../gcc/c-parse.c
c-parse.y: In function `yyparse':
c-parse.y:279: invalid type argument of `->'
c-parse.y:280: invalid type argument of `->'
... ...

Perhaps the first error was somthing about the lib, but what's the reason
of the second error?


Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



- ------------------------------

From: Lin Zhe Min <[EMAIL PROTECTED]>
Date: Sun, 17 Jan 1999 08:13:11 +0000 (GMT)
Subject: Re: glibc 2.0.110

On Sat, 16 Jan 1999, Fenglou Mao wrote:
>    The most recent crypt I can found is glibc-crypt-2.0.108.
>    Is it right?

No. You can get 2.0.109 in http://www.ozemail.com.au/~geoffk/pgp/.
Why don't you read Ulrich's release-notes?


.e'osai ko sarji la lojban.     =3D=3D> =BD=D0=A4=E4=AB=F9=C5=DE=BF=E8=BBy=A8=A5=
=A1C
co'o mi'e lindjy,min.           =3D=3D> =A6A=A8=A3=A1A=A7=DA=ACO=AAL=AD=F5=A5=C1=A1C
Fingerprint20 =3D CE32 D237 02C0 FE31 FEA9  B858 DE8F AE2D D810 F2D9

- ------------------------------

From: Lin Zhe Min <[EMAIL PROTECTED]>
Date: Sun, 17 Jan 1999 08:21:29 +0000 (GMT)
Subject: Re: gcc&g++(egcs1.1.1) how to find its head files and lib?

It depends on which part you need. Check
/usr/include
/usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.60/include/
        (This may vary from different version)
or even
/usr/src/linux/include
to find what you need.

Try to read some documents, and run your `locate' (type `locate filename' 
in shell prompt), ok?


.e'osai ko sarji la lojban.     =3D=3D> =BD=D0=A4=E4=AB=F9=C5=DE=BF=E8=BBy=A8=A5=
=A1C
co'o mi'e lindjy,min.           =3D=3D> =A6A=A8=A3=A1A=A7=DA=ACO=AAL=AD=F5=A5=C1=A1C
Fingerprint20 =3D CE32 D237 02C0 FE31 FEA9  B858 DE8F AE2D D810 F2D9

- ------------------------------

From: [EMAIL PROTECTED]
Date: Sun, 17 Jan 1999 18:01:47 +0000 (GMT)
Subject: Problem compiling glibc-2.0.110

 get the following errors when compiling glibc-2.0.110 with egcs-1.1.1,
binutils2.9.1.0.19a, kernel 2.2pre7ac4, glibc-2.0.109, latest linuxthreads
and crypt

egcs wcfuncs.c -c -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g     
- -I../include -I.
- -I/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/build-i386-linux/wctype -I..
- -I../libio  -I/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/build-i386-linux
- -I../sysdeps/i386/elf -I../crypt/sysdeps/unix
- -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread
- -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix
- -I../linuxthreads/sysdeps/i386 -I../linuxthreads/sysdeps/pthread/no-cmpxchg
- -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux
- -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
- -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv
- -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix
- -I../sysdeps/i386/fpu -I../sysdeps/libm-i387 -I../sysdeps/i386
- -I../sysdeps/wordsize-32 -I../sysdeps/ieee754 -I../sysdeps/libm-ieee754
- -I../sysdeps/generic/elf -I../sysdeps/generic  -nostdinc -isystem
/usr/lib/gcc-lib/i3!
86-redhat-linux/egcs-2.91.60/include -isystem
/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/linux/include -D_LIBC_REENTRANT
- -include ../include/libc-symbols.h     -o
/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/build-i386-linux/wctype/wcfuncs.=
o
wcfuncs.c: In function `__iswalnum':
wcfuncs.c:42: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:42: (Each undeclared identifier is reported only once
wcfuncs.c:42: for each function it appears in.)
wcfuncs.c:42: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswalpha':
wcfuncs.c:44: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:44: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswcntrl':
wcfuncs.c:46: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:46: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswdigit':
wcfuncs.c:48: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:48: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswlower':
wcfuncs.c:50: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:50: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswgraph':
wcfuncs.c:52: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:52: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswprint':
wcfuncs.c:54: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:54: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswpunct':
wcfuncs.c:56: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:56: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswspace':
wcfuncs.c:58: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:58: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswupper':
wcfuncs.c:60: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:60: warning: control reaches end of non-void function
wcfuncs.c: In function `__iswxdigit':
wcfuncs.c:62: `__ctype32_b' undeclared (first use in this function)
wcfuncs.c:62: warning: control reaches end of non-void function
make[2]: ***
[/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/build-i386-linux/wctype/wcfuncs=
.o]
Error 1
make[2]: Leaving directory
`/usr/src/redhat/rawhide/BUILD/glibc-2.0.110/wctype'
make[1]: *** [wctype/subdir_lib] Error 2
make[1]: Leaving directory `/usr/src/redhat/rawhide/BUILD/glibc-2.0.110'
make: *** [all] Error 2
Bad exit status from /var/tmp/rpm-tmp.58428 (%build)

I would be grateful for any help/advice.  I have looked in the documentation

Peter Dyer

- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 17 Jan 1999 10:13:11 -0800
Subject: Re: Problem compiling glibc-2.0.110

[EMAIL PROTECTED] writes:

>  get the following errors when compiling glibc-2.0.110 with egcs-1.1.1,
binutils2.9.1.0.19a, kernel 2.2pre7ac4, glibc-2.0.109, latest linuxthreads
and crypt

Compile with optiization.

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: Todd Roy <[EMAIL PROTECTED]>
Date: Mon, 18 Jan 1999 09:08:51 -0500 (EST)
Subject: Re: A question about the version number of glib-c?

**********************************************************************
This footnote confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.
**********************************************************************

- ------------------------------

From: Todd Roy <[EMAIL PROTECTED]>
Date: Mon, 18 Jan 1999 09:13:49 -0500 (EST)
Subject: Re: A question about the version number of glib-c?

>  Date:        Sat, 16 Jan 1999 15:46:25 -0800 (PST)
>  From:        Fenglou Mao <[EMAIL PROTECTED]>
>  Content-Type: TEXT/PLAIN; charset=3DUS-ASCII
>  Sender: [EMAIL PROTECTED]
>  Precedence: bulk
>  X-Loop: [EMAIL PROTECTED]
>  X-Orcpt: rfc822;linux-gcc-outgoing-dig
>  
>  Dear all,
>       I saw glibc-2.0.1, glibc-2.0.2, ..., glibc-2.0.5...
>       But Ulrich Drepper released the newest version of glibc-2.0.110.
>       I am confused, which one is the newest? 
>  
>  Sincerely Yours,
>  
>  FengLou Mao
>  *******************************
>  ADD:Mr. FengLou Mao
>      Peking University
>      BeiJing
>      P.R.China
>  Tel:86-10-62751490
>  Fax:86-10-62751725
>  
>  
>  
>  
>  

Sir,
  What you are seeing is two different development trees.

One is for glibc 2.0, the other for glibc 2.1

Generally, if you see something like glibc-XXXX-2.0.Y, where Y is
a single digit, that is a release for glibc 2.0.  If you see something
like glibc-XXXX-2.0.YYY where YYY is two or three digits, that is a test
release for glibc 2.1.  

Also note, 2.0 has been released.  I believe that the current version is
2.0.6, which can be found at ftp.gnu.org.  There are development releases
in the form glibc-2.0.YpreN at alpha.gnu.org.

2.1 has not been released yet, though I can attest it is getting very close.
You can find development copies at alpha.gnu.org.


I apoligize for sending a blank message a few minutes ago.  Slip of the
fingers.

- - -- todd --

**********************************************************************
This footnote confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.
**********************************************************************

- ------------------------------

From: Socrate <[EMAIL PROTECTED]>
Date: Mon, 18 Jan 1999 17:46:44 +0200 (EET)
Subject: Help needed on pop3 client

Hello!

A part from a larger project that I have require to me to write a very
simple C program that connect through port 110 to a pop3 server and to
download all messages in a single file. The syntax should be:
$ program user host
and then the program should prompt for password. Then he has to get all
messages into a single local file.

I read RFCs 821 and 822 and I take a look on some examples of others
program but I didn't really approach of the goal. So, please, if anybody
can to help me with the source code of such a simple programm. Some extra
line of comment should be just perfect.

Thx a lot in advance!

Ave,
  Socrate







- ------------------------------

From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 18 Jan 1999 14:47:43 -0500
Subject: LinuxThreads stack layout is not good

The appended program, when run on a stock Red Hat 5.2 system, produces
incorrect output after allocating approximately 6 megs of stack space.
Output appears after the program.  (Don't forget "-lpthread" if you
compile it yourself.)

The problem is that the LinuxThreads library sets its internal notion
of STACK_SIZE to a constant 2M.  It subtracts twice STACK_SIZE from
the initial value of the stack pointer and rounds down to a multiple
of STACK_SIZE to figure out a nominal "bottom-of-stack" value
for the initial thread.

It uses this bottom-of-stack value for two things.

First, it uses it to figure out which thread is calling into the
library (e.g., for thread_self() and for thread specific data); this
is the problem illustrated by the test case below.  Once esp goes
below the bottom-of-stack value, the library no longer knows that the
calling thread is the initial thread.  (A stock Red Hat system has a
stack size rlimit of 8M.)

Second, it uses the initial thread bottom-of-stack as the top of an
array of contiguously allocated STACK_SIZE chunks, which serve as the
stacks for additional threads.  That is, the second, third,
etc. threads will have stacks which are contiguously allocated below
the nominal bottom-of-stack of the initial thread.  If the stack size
rlimit is greater than 2M, this means each thread will have a stack
overlapping that of some other thread.

This is a Bad Thing.  Not only does it limit each thread's stack usage
to a compiled-in constant of 2M (a value neither detectable nor
settable through getrlimit/setrlimit), it also prevents the kernel
from generating a signal on stack overflow for most threads.  And
while that may be fine for C, it creates a royal pain for people (like
us) who are trying to implement a safe language on top of
LinuxThreads.

I think two things need to happen to fix these problems.

First, STACK_SIZE in LinuxThreads needs to default to a value greater
than the kernel-determined hard rlimit (under Linux, I believe this is
8M).  I realize this will reduce the number of threads you can create,
so perhaps STACK_SIZE should be settable at run-time as part of an
advanced LinuxThreads-specific interface.  Either way, having some
lower value hard-wired in is truly irritating.

Second, LinuxThreads should leave some amount of unallocated,
inaccessible memory between the stacks of the various threads.
Whether that is 4K or 8M, I don't care; it just needs to be an
advertised value so that we can write proper stack probes when
allocating stack space.  (Yes, in JIT-compiled code we could just test
the esp every time, but some of our code is written in C, and all we
can do there is place bounds on the local variable space used.)
Without these sentinels, it is a real pain to guarantee that a user
cannot violate the safety of the language.

Thanks for your time.

 - Pat

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

#include <stdio.h>
#include <pthread.h>

void * volatile x;

int
main(int argc, char *argv[])
{
  pthread_key_t k;
  size_t s;

  pthread_key_create(&k, 0);
  pthread_setspecific(k, (void *)0x100);

  for (s =3D 0; s < 80; s++)
    {
      printf("%ldK %p\n", s * 100L, pthread_getspecific(k));
      x =3D alloca(100 * 1024);
    }

  return 0;
}

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

0K 0x100
100K 0x100
200K 0x100
300K 0x100
400K 0x100
500K 0x100
600K 0x100
700K 0x100
800K 0x100
900K 0x100
1000K 0x100
1100K 0x100
1200K 0x100
1300K 0x100
1400K 0x100
1500K 0x100
1600K 0x100
1700K 0x100
1800K 0x100
1900K 0x100
2000K 0x100
2100K 0x100
2200K 0x100
2300K 0x100
2400K 0x100
2500K 0x100
2600K 0x100
2700K 0x100
2800K 0x100
2900K 0x100
3000K 0x100
3100K 0x100
3200K 0x100
3300K 0x100
3400K 0x100
3500K 0x100
3600K 0x100
3700K 0x100
3800K 0x100
3900K 0x100
4000K 0x100
4100K 0x100
4200K 0x100
4300K 0x100
4400K 0x100
4500K 0x100
4600K 0x100
4700K 0x100
4800K 0x100
4900K 0x100
5000K 0x100
5100K 0x100
5200K 0x100
5300K 0x100
5400K 0x100
5500K 0x100
5600K 0x100
5700K 0x100
5800K 0x100
5900K 0x100
6000K 0x100
6100K 0x100
6200K (nil)
6300K (nil)
6400K (nil)
6500K (nil)
6600K (nil)
6700K (nil)
6800K (nil)
6900K (nil)
7000K (nil)
7100K (nil)
7200K (nil)
7300K (nil)
7400K (nil)
7500K (nil)
7600K (nil)
7700K (nil)
7800K (nil)
7900K (nil)

- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 18 Jan 1999 12:33:56 -0800
Subject: Re: LinuxThreads stack layout is not good

[EMAIL PROTECTED] (Patrick J. LoPresti) writes:

> This is a Bad Thing.  Not only does it limit each thread's stack usage
> to a compiled-in constant of 2M (a value neither detectable nor
> settable through getrlimit/setrlimit), it also prevents the kernel
> from generating a signal on stack overflow for most threads. 

You should at least try to get some understanding on the current
situation before complaining loudly.  None of your points is valid for
the LinuxThreads version which currently is released with the glibc
test releases.

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 18 Jan 1999 15:48:49 -0500
Subject: Re: LinuxThreads stack layout is not good

 drepper> You should at least try to get some understanding on the
 drepper> current situation before complaining loudly.  None of your
 drepper> points is valid for the LinuxThreads version which currently
 drepper> is released with the glibc test releases.

A simple "fixed in glibc 2.1" would have sufficed.

I do not have a test release of glibc.  I neither know nor
particularly care where to get one.  The "Reporting Bugs" section of
the Texinfo manual does not say, "please make sure your bug hasn't
been fixed in some test release", it says to indicate what version of
glibc you are using (which I did implicitly by indicating "stock Red
Hat Linux 5.2").

I sent my bug report to Xavier (as the LinuxThreads documentation says
to do), bug-glibc (as the glibc documentation says to do), and
linux-gcc (since it is a Linux-specific problem).  Which of these
qualifies as "complaining loudly"?

If you expect some other procedure to be followed when reporting bugs,
you should document such, and not slam someone for following the
procedure you DID document.

I am glad to hear that the problems have been fixed; thanks.

 - Pat

- ------------------------------

From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 18 Jan 1999 16:16:08 -0500
Subject: Re: LinuxThreads stack layout is not good

>>>>> "drepper" =3D=3D Ulrich Drepper <[EMAIL PROTECTED]> writes:

 drepper> You should at least try to get some understanding on the
 drepper> current situation before complaining loudly.  None of your
 drepper> points is valid for the LinuxThreads version which currently
 drepper> is released with the glibc test releases.

I am now looking at glibc-linuxthreads-2.0.110 (I hope that is current
enough), and the only relevant differences I see are:

  1) The library calls "setrlimit" to set the current stack size limit
     to a little under 2 meg.

  2) There is a "__pthread_nonstandard_stacks" variable which appears
     to allow, in principle, different threads to have different-sized
     stacks.

It seems to me that (1) does not solve the problem, because any user
program that (completely legitimately) calls "setrlimit" itself will
break the library.  This could be fixed by defining STACK_SIZE to be
larger than (or equal to) the kernel-enforced hard limit.

As for (2), the support isn't really there; the variable
__pthread_nonstandard_stacks is initialized to zero and never
modified.  This appears to be the start of a not-yet-finished
interface.

Since "none of my points is valid for the LinuxThreads version which
currently is released with the glibc test releases", I assume I am
missing something.  What is it?

 - Pat

- ------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 18 Jan 1999 13:20:21 -0800
Subject: Re: LinuxThreads stack layout is not good

[EMAIL PROTECTED] (Patrick J. LoPresti) writes:

> Since "none of my points is valid for the LinuxThreads version which
> currently is released with the glibc test releases", I assume I am
> missing something.  What is it?

int __pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)

- - -- 
- - ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- ------------------------------

From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 18 Jan 1999 16:46:49 -0500
Subject: Re: LinuxThreads stack layout is not good

>>>>> "drepper" =3D=3D Ulrich Drepper <[EMAIL PROTECTED]> writes:

 drepper> int __pthread_attr_setstacksize(pthread_attr_t *attr, size_t
 drepper> stacksize)

OK, thanks.  I still think I see two problems:

First, manager.c:pthread_allocate_stack() needs to set
__pthread_nonstandard_stacks to 1 if the user provided a stack.
Otherwise, if the user provides a stack which is not aligned to a
multiple of 2M the default thread_self() implementation will not
correctly find the thread data.  I am pretty sure this is an outright
bug (though easy to fix).  Actually, you only need set it if the value
provided by the user is not aligned to a STACK_SIZE boundary, I think.

Second, the value passed to pthread_attr_setstacksize is limited to 2M
(see manager.c line 263).  In other words, each thread (including the
first) is still limited to a stack size of 2M, despite the usual
kernel limit of 8M.  There should be some way to get stack sizes of 8M
with sentinels.  I would even argue that this should be the default,
and that users who need many many threads can write something special
to notify the library.  But even if it is not the default, there
should be *some* way to get the effect.

Yes, I can use pthread_attr_setstackaddr, but what if I need
sentinels?  Do I need to play mmap() games (and if so, how exactly
should I play them)?  It would be nice to have an interface for this,
even a Linux-specific one.

 - Pat

- ------------------------------

From: "David S. Miller" <[EMAIL PROTECTED]>
Date: Mon, 18 Jan 1999 19:29:07 -0800
Subject: Re: LinuxThreads stack layout is not good

   From: [EMAIL PROTECTED] (Patrick J. LoPresti)
   Date: 18 Jan 1999 14:47:43 -0500

   it also prevents the kernel from generating a signal on stack
   overflow for most threads.

This is what signal stacks are for, use them.

Later,
David S. Miller
[EMAIL PROTECTED]

- ------------------------------

From: [EMAIL PROTECTED] (H.J. Lu)
Date: Mon, 18 Jan 1999 20:08:49 -0800 (PST)
Subject: Please try egcs 1.1.1 19990115/Linux.

Please try out egcs 1.1.1 19990115/Linux. There are 3 files to test

ftp://ftp.yggdrasil.com/private/hjl/egcs/1.1.1/egcs-1.1.1-19990115-linux.dif=
f.gz
ftp://ftp.yggdrasil.com/private/hjl/egcs/1.1.1/release.egcs-1.1.1
ftp://ftp.yggdrasil.com/private/hjl/egcs/1.1.1/egcs-1.1.1.spec

Please check them out. I'd like to know the results for egcs-1.1.1.spec,
Linux/ARM and Linux/MIPS before I make them public.

Thanks.


H.J.
- - ----
This is the Linux/x86/alpha binary release of egcs 1.1.1 19990115/Linux.
egcs is an integrated GNU compiler system. It is derived from gcc with
many enhancements. The current egcs contains C, C++, Object C and f77
compilers plus their runtime libraries. It is highly recommended on
Linux as the default C/C++ compiler system. For details about egcs
and its source code, please consult its web page at

http://egcs.cygnus.com

The egcs 1.1.1 linux/x86 binary release can be found at

ftp://ftp.kernel.org/pub/linux/devel/gcc
ftp://tsx-11.mit.edu/pub/linux/packages/GCC
ftp://sunsite.unc.edu/pub/Linux/GCC

The bzip2 linux/x86 binaries are provided for libc 5 and glibc 2. They
are bzip2-libc5.gz and bzip2-glibc.gz in the same ftp directory.

The file list

1. egcs-1.1.1-glibc.x86.tar.bz2
   In ELF/x86 and generate ELF binaries for glibc 2. gcc, cpp, cc1,
   cc1plus, cc1objc, g77, version dependent header files, libstdc++,
   libg++ and libg2c.a. Object C, protoize and unprotoize are untested.
   To install

        # cd /
        # bzip2 -dc egcs-1.1.1-glibc.x86.tar.bz2 | tar xvvf -

   You need glibc 2.0.7 or above to use it.

2. egcs-1.1.1-alpha.tar.bz2
   In ELF/alpha and generate ELF binaries for glibc 2. gcc, cpp, cc1,
   cc1plus, cc1objc, g77, version dependent header files, libstdc++,
   libg++ and libg2c.a. Object C, protoize and unprotoize are untested.
   To install

        # cd /
        # bzip2 -dc egcs-1.1.1-alpha.tar.bz2 | tar xvvf -

   You need glibc 2.0.7 or above to use it.

3. egcs-1.1.1-libc5.x86.tar.bz2
   In ELF/x86 and generate ELF binaries for libc 5. gcc, cpp, cc1,
   cc1plus, cc1objc, g77, version dependent header files, libstdc++,
   libg++ and libg2c.a. Object C, protoize and unprotoize are untested.
   To install

        # cd /
        # bzip2 -dc egcs-1.1.1-libc5.x86.tar.bz2 | tar xvvf -

   You need libc 5.4.44 or above to use it.

4. egcs-1.1.1-doc.tar.bz2
   Man pages and info files for egcs and libg++. To install

        # cd /
        # bzip2 -dc egcs-1.1.1-doc.tar.bz2 | tar xvvf -

5. egcs-1.1.1-19990115-linux.diff.gz
   A patch file which brings egcs 1.1.1 to egcs 1.1.1 19990115/Linux.

6. egcs-1.1.1.spec
   A RPM spec file. You can use it to build egcs 1.1.1 19990115/Linux
   if you have a good network connection. For example,

        # rpm -ba egcs-1.1.1.spec

   should get source and patch via ftp, then source rpm and binary rpm.

Please fix the file/directory permissions after unpacking the package
if necessary.

Please report any missing/corrupted files to [EMAIL PROTECTED]


H.J.
[EMAIL PROTECTED]
01/19/99

- ------------------------------

From: "Neil Youngman" <[EMAIL PROTECTED]>
Date: Tue, 19 Jan 1999 09:27:13 -0000
Subject: dynamic linker problem

We have a system, which uses dlopen() to load some libraries.

On Solaris and SCO system V we create a library with a line like:

        cc -fpic a.o b.o -ly -o libx.so

then when we load libx with dlopen() it also loads liby.so. 
On Linux we have been unable to get this to work. There are 
possible workarounds, but we would like to stick with the 
same solution that we already use on our other systems. 

Does anyone if this can be made to work on Linux?

Neil

- ------------------------------

From: Andreas Jaeger <[EMAIL PROTECTED]>
Date: 19 Jan 1999 17:45:04 +0100
Subject: Re: dynamic linker problem

>>>>> Neil Youngman writes:

 > We have a system, which uses dlopen() to load some libraries.
 > On Solaris and SCO system V we create a library with a line like:

 >      cc -fpic a.o b.o -ly -o libx.so

 > then when we load libx with dlopen() it also loads liby.so. 
 > On Linux we have been unable to get this to work. There are 
 > possible workarounds, but we would like to stick with the 
 > same solution that we already use on our other systems. 

 > Does anyone if this can be made to work on Linux?
Which libc are you using?


The following should work with glibc2:
cc -fpic a.o b.o -shared -ly -o libx.so

If this doesn't work with glibc2, please supply a short test (just two
or three simple files) showing the problem.

Andreas
- - -- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

- ------------------------------

From: holotko <[EMAIL PROTECTED]>
Date: Wed, 20 Jan 1999 08:14:48 +0000
Subject: Re: A question about the version number of glib-c?

Todd Roy wrote:
> 
> **********************************************************************
> This footnote confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> **********************************************************************

??? Huh??? What???


- - -- 
email: [EMAIL PROTECTED]
Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>

He was not at all afraid for to be mashed into a pulp, or to have his
eyes gouged out and his elbows broken.

- ------------------------------

From: Robert Roebling <[EMAIL PROTECTED]>
Date: Wed, 20 Jan 1999 14:27:28 +0000
Subject: ldd bug

  Hi,

Im using an unmodified SuSE 6.0 distribution
that comes with glibc 2.0.7 (which SuSE 6.0
modified to make it work with both libc 5
and glibc 2, I think). "ldd --version" just
says "2.0.7" and "ld --version" says "2.9.1"
if that matters.

My problem is that I'm using the iODBC library,
which is a bit special as it defines a number
of functions (namely those defined by the ODBC
standard) and loads a library for a specific
data base connection. This specific library also
has to defines all the functions of the ODBC
standard (and it couldn't work otherwise). If
I link my program statically with iODBC, I have
no problems, but when I link it dynamically, the
Linux linker gets it wrong, because the specific
ODBC driver (PostgreSQL ODBC to be precise, but
it could be any) also happen to call a few of
the ODBC functions internally and it aims to call
the ODBC functions defined in the driver, not
in iODBC, but ldd sends the calls to iODBC and
my program to heaven.

I post this to both linux-gcc and SuSE as I don't 
know where the bug was introduced (guessing on
SuSE).

I'd be thankful for a reply (sent to me, I'm not
subscribed to this list).

   Robert Roebling


- ------------------------------

From: "Neil Youngman" <[EMAIL PROTECTED]>
Date: Wed, 20 Jan 1999 17:05:28 -0000
Subject: RE: dynamic linker problem

> The following should work with glibc2:
> cc -fpic a.o b.o -shared -ly -o libx.so
> 
> If this doesn't work with glibc2, please supply a short test (just two
> or three simple files) showing the problem.

Oops. I was missing the obvious. Due to an error in the makefile it wasn't 
looking it in the right area for the libraries and I misinterpreted the 
linker errors. 

Thanks for your help

Neil


- ------------------------------

From: holotko <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 03:33:15 +0000
Subject: C++ Destructor Question

Being spoiled by Java's garbage collector leads me to this quick
question again concerning constructors in C++.

If I allocate memory via "new" using a constructor

i.e.

    class Foo
    {
      Foo()
        { word =3D new char[LENGTH + 1];  }

      ~Foo()
        { delete word; }
        
        ...
     }

When I create an object of class Foo memory will be allocated for the
char buffer "word". Now when the object is no longer needed must I
make an explicit call to the destructor ~Foo() to destroy the object
and subsequently call "delete", or, is the destructor somehow called
automatically when the object is no  longer needed,i.e.  outside of
it's scope?

Even in Java there are times when it is up to you to destroy an object
and/or free memory used for that object, depending on how the object
is/was created and an method equivalent of a destructor is required...
The garbage collector is not always adequate.

Thanks...

Sincerely,

/John <[EMAIL PROTECTED]>


- - -- 
email: [EMAIL PROTECTED]
Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>

There is a great alternative to war, it's called Peace.

- ------------------------------

From: Suresh <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 99 12:02:58 IST
Subject: Re: C++ Destructor Question

Hi,
The destructor is automatically called when the
object in question is no longer needed. Such as
an object is created inside a function locally and
when the function returns the object gets killed with
the destructor executed. Hence we dont call the 
destructor explicitly.

And in java I feel the garbage collection concept is
implemented quite strong and rarely do we use explicit
deallocation.

Cheers,
Suresh 
Wipro-Nortel Networks
Bangalore
>
>
>Being spoiled by Java's garbage collector leads me to this quick
>question again concerning constructors in C++.
>
>If I allocate memory via "new" using a constructor
>
>i.e.
>
>    class Foo
>    {
>      Foo()
>        { word =3D new char[LENGTH + 1];  }
>
>      ~Foo()
>        { delete word; }
>        
>        ...
>     }
>
>When I create an object of class Foo memory will be allocated for the
>char buffer "word". Now when the object is no longer needed must I
>make an explicit call to the destructor ~Foo() to destroy the object
>and subsequently call "delete", or, is the destructor somehow called
>automatically when the object is no  longer needed,i.e.  outside of
>it's scope?
>
>Even in Java there are times when it is up to you to destroy an object
>and/or free memory used for that object, depending on how the object
>is/was created and an method equivalent of a destructor is required...
>The garbage collector is not always adequate.
>
>Thanks...
>
>Sincerely,
>
>/John <[EMAIL PROTECTED]>
>
>
>-- 
>email: [EMAIL PROTECTED]
>Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
>
>There is a great alternative to war, it's called Peace.
>


- - --

- ------------------------------

From: Joseph Keen <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 07:25:49 -0500 (EST)
Subject: Re: C++ Destructor Question

In C++ you must always specifically call the destructor before the
variable goes out of scope.  When it goes out of scope the variable name
and the memory it points to become unlinked and there is no way for you to
go back and free that memory.  That's how you get memory leaks :)

> i.e.
> 
>     class Foo
>     {
>       Foo()
>         { word =3D new char[LENGTH + 1];  }
> 
>       ~Foo()
>         { delete word; }
>         
>         ...
>      }
> 
> When I create an object of class Foo memory will be allocated for the
> char buffer "word". Now when the object is no longer needed must I
> make an explicit call to the destructor ~Foo() to destroy the object
> and subsequently call "delete", or, is the destructor somehow called
> automatically when the object is no  longer needed,i.e.  outside of
> it's scope?


- ------------------------------

From: Jakob Andreas Baerentzen <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 13:55:11 +0100 (MET)
Subject: Re: C++ Destructor Question

> In C++ you must always specifically call the destructor before the
> variable goes out of scope.  When it goes out of scope the variable name
> and the memory it points to become unlinked and there is no way for you to
> go back and free that memory.  That's how you get memory leaks :)

I think the above is a bit confusing. THe question was about calling the
destructor and then something about scope.

But talking about scope is confusing, since what you are talking about is
the pointers scope ... not the dynamically allocated object (would that
even make sense ... i.e. can you talk about the scope of a dynamic object
?)

Certainly memory leaks if an only pointer to some object goes out of scope
... but in many cases this doesn't matter since some other pointer will be
passed the address of the object in question.

Anyway, as Suresh pointed out, when a dynamic object is deleted it's
destructor is implicitly called.

To sum up the ways objects are destroyed:

1 When a dynamic object is deleted, the destructor is called IMPLICITLY

2 An automatic object (on the stack AFAIK) or static object will be
destroyed automatically, when it goes out of scope - i.e. at the end of a
block or at program termination, and then the destructor is called
IMPLICITLY.

The example below should serve as illustration. Three objects are created
in different ways. All are destroyed, but none explicitly. Actually, you
only rarely call the destructor EXPLICITLY, but take a look at:
 
http://www.cerfnet.com/~mpcline/C++-FAQs-Lite/

- - -------------------------
#include <iostream.h>

class foo 
{ 
        int x;  

public: 
        foo(int _x):x(_x) {}
        ~foo() { cout << "I am destroyed: " << x <<endl; } 
}; 

foo z(1);  

main()  
{
        foo * x =3D new foo(2); 
        delete x; 
        foo y(3);  
}
 ------- 
I am destroyed: 2 
I am destroyed: 3 
I am destroyed: 1








- ------------------------------

End of linux-gcc-digest V1 #358
*******************************

To subscribe to linux-gcc-digest, send the command:

        subscribe linux-gcc-digest

in the body of a message to "[EMAIL PROTECTED]".  If you
want
to subscribe something other than the account the mail is coming from,
such as a local redistribution list, then append that address to the
"subscribe" command; for example, to subscribe "local-linux-gcc":

        subscribe linux-gcc-digest [EMAIL PROTECTED]

A non-digest (direct mail) version of this list is also available; to
subscribe to that instead, replace all instances of "linux-gcc-digest"
in the commands above with "linux-gcc".

- --=_ORCL_10518737_0_0--


------------------------------

From: John Weldon <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 11:22:05 -0800
Subject: RE: C++ Destructor Question

In C++, when an object(variable as you call it) goes out of scope its'
destructor is automatically called. If the call to delete is in the
destructor then the memory will be freed before the object is completely
unlinked.

John Weldon

- -----Original Message-----
From: Joseph Keen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 21, 1999 4:26 AM
To: holotko
Cc: Linux C Programming; [EMAIL PROTECTED]
Subject: Re: C++ Destructor Question


In C++ you must always specifically call the destructor before the
variable goes out of scope.  When it goes out of scope the variable name
and the memory it points to become unlinked and there is no way for you
to
go back and free that memory.  That's how you get memory leaks :)

> i.e.
> 
>     class Foo
>     {
>       Foo()
>         { word = new char[LENGTH + 1];  }
> 
>       ~Foo()
>         { delete word; }
>         
>         ...
>      }
> 
> When I create an object of class Foo memory will be allocated for the
> char buffer "word". Now when the object is no longer needed must I
> make an explicit call to the destructor ~Foo() to destroy the object
> and subsequently call "delete", or, is the destructor somehow called
> automatically when the object is no  longer needed,i.e.  outside of
> it's scope?

------------------------------

From: Mike Brownlow <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 14:57:11 -0600
Subject: Re: C++ Destructor Question

Hi,

 I have a question. For arrays allocated with new I was taught to delete them
like:

delete [] array;

When the following is done, does it merely delete the "pointer" or does it also
delete the array:

delete array;

?

Or, if more appropriate, where can I look for more information?

TIA,
mike

holotko <[EMAIL PROTECTED]> wrote:
> 
> Being spoiled by Java's garbage collector leads me to this quick
> question again concerning constructors in C++.
> 
> If I allocate memory via "new" using a constructor
> 
> i.e.
> 
>     class Foo
>     {
>       Foo()
>         { word = new char[LENGTH + 1];  }
> 
>       ~Foo()
>         { delete word; }
>         
>         ...
>      }
> 
> When I create an object of class Foo memory will be allocated for the
> char buffer "word". Now when the object is no longer needed must I
> make an explicit call to the destructor ~Foo() to destroy the object
> and subsequently call "delete", or, is the destructor somehow called
> automatically when the object is no  longer needed,i.e.  outside of
> it's scope?
> 
> Even in Java there are times when it is up to you to destroy an object
> and/or free memory used for that object, depending on how the object
> is/was created and an method equivalent of a destructor is required...
> The garbage collector is not always adequate.
> 
> Thanks...
> 
> Sincerely,
> 
> /John <[EMAIL PROTECTED]>
> 
> 
> -- 
> email: [EMAIL PROTECTED]
> Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
> 
> There is a great alternative to war, it's called Peace.

------------------------------

From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: 21 Jan 1999 18:08:59 -0800
Subject: glibc 2.0.111

The next test release is out.  The last things I wanted to change did
change and the reported problems should all be corrected.  I hopefully
haven't introduced new problems and if this is the case glibc 2.1.0
will be out within days.

You can download the files

        glibc-2.0.111.tar.gz
        glibc-linuxthreads-2.0.111.tar.gz
        glibc-2.0.110-2.0.111.diff.gz

from

        ftp://sourceware.cygnus.com/pub/glibc
        ftp://alpha.gnu.org/gnu

and the kernel.org network

        ftp://ftp.CC.kernel.org/pub/software/libs/glibc

where CC is the country code for the server most convenient.

Please report any problems and also success reports to
[EMAIL PROTECTED]

- -- 
- ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

------------------------------

From: "Prasanna Bose" <[EMAIL PROTECTED]>
Date: Thu, 21 Jan 1999 15:32:55 PST
Subject: Re: C++ Destructor Question

Actually the destructor should be
      ~Foo()
        { delete[] word; } // as an array has been allocated.

vive,
Prasanna subash


>Hi,
>The destructor is automatically called when the
>object in question is no longer needed. Such as
>an object is created inside a function locally and
>when the function returns the object gets killed with
>the destructor executed. Hence we dont call the 
>destructor explicitly.
>
>And in java I feel the garbage collection concept is
>implemented quite strong and rarely do we use explicit
>deallocation.
>
>Cheers,
>Suresh 
>Wipro-Nortel Networks
>Bangalore
>>
>>
>>Being spoiled by Java's garbage collector leads me to this quick
>>question again concerning constructors in C++.
>>
>>If I allocate memory via "new" using a constructor
>>
>>i.e.
>>
>>    class Foo
>>    {
>>      Foo()
>>        { word = new char[LENGTH + 1];  }
>>
>>      ~Foo()
>>        { delete word; }
>>        
>>        ...
>>     }
>>
>>When I create an object of class Foo memory will be allocated for the
>>char buffer "word". Now when the object is no longer needed must I
>>make an explicit call to the destructor ~Foo() to destroy the object
>>and subsequently call "delete", or, is the destructor somehow called
>>automatically when the object is no  longer needed,i.e.  outside of
>>it's scope?
>>
>>Even in Java there are times when it is up to you to destroy an object
>>and/or free memory used for that object, depending on how the object
>>is/was created and an method equivalent of a destructor is required...
>>The garbage collector is not always adequate.
>>
>>Thanks...
>>
>>Sincerely,
>>
>>/John <[EMAIL PROTECTED]>
>>
>>
>>-- 
>>email: [EMAIL PROTECTED]
>>Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
>>
>>There is a great alternative to war, it's called Peace.
>>
>
>
>--


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

------------------------------

From: Christopher Sekiya <[EMAIL PROTECTED]>
Date: Fri, 22 Jan 1999 22:59:48 +0900 (JST)
Subject: Re: glibc 2.0.111

On 21 Jan 1999, Ulrich Drepper wrote:

> I hopefully haven't introduced new problems and if this is the case
> glibc 2.1.0 will be out within days.

Has anyone besides me tried glibc-2.0.109/110 on sparc32?  I'm seeing
reproduceable segfaults during 'make check' in the math subdirectory. This
is with egcs-1.1b, egcs-1.1.1, and egcs-19990117 with '-O99
- -fomit-frame-pointer', '-O1', and '' for optimization flags.

Now that the weekend has come, I'll try to ferret out the problem.  I'd
appreciate it if someone else could confirm or deny the behavior that I'm
seeing.

- --    Chris ([EMAIL PROTECTED])


------------------------------

From: Herry Budiutama <[EMAIL PROTECTED]>
Date: Fri, 22 Jan 1999 10:52:13 -0500 (EST)
Subject: Re: C++ Destructor Question

On Thu, 21 Jan 1999, Joseph Keen wrote:

> In C++ you must always specifically call the destructor before the
> variable goes out of scope.  When it goes out of scope the variable name
> and the memory it points to become unlinked and there is no way for you to
> go back and free that memory.  That's how you get memory leaks :)

The destructor of an object is automatically called when the object goes
out of scope. There's no need to "specifically call the destructor" (which
I think you mean 'explicitly').

> >     class Foo
> >     {
> >       Foo()
> >         { word = new char[LENGTH + 1];  }
> > 
> >       ~Foo()
> >         { delete word; }

delete[] word;

- - Herry



------------------------------

From: "Martin v. Loewis" <[EMAIL PROTECTED]>
Date: Sat, 23 Jan 1999 12:24:13 +0100
Subject: Re: egcs thread question.

>    Did egcs have a built-in thread library?

egcs in itself does not have a thread library.

>    If not, where can I find one?

glibc 2 (aka libc 6) comes with a pthreads implementation.

>    What is the different between "/usr/include/pthread.h" and 
> "/usr/include/pthread/mit/pthread.h"?

To get files from /usr/include, write

#include <pthread.h>

pthread/mit/pthread.h is specific to some implementation of pthreads,
don't use it. Use <pthread.h> instead.

Martin

------------------------------

From: "Martin v. Loewis" <[EMAIL PROTECTED]>
Date: Sat, 23 Jan 1999 12:25:56 +0100
Subject: Re: gcc&g++(egcs1.1.1) how to find its head files and lib?

> As title.

Read documentation. See /usr/lib/gcc-lib/*/*/specs.

Martin

------------------------------

From: HERNAN MONSERRAT <[EMAIL PROTECTED]>
Date: Sat, 23 Jan 1999 19:57:35
Subject: Suscribe, Add

____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1

------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Mon, 25 Jan 1999 19:10:31 -0800 (PST)
Subject: A question about STL.

Dear all,
    I think vector of STL in g++ can not substitute traditional array,
because the address of array elements is fixed, but in 'vector' it is 
not true. Because vector is dynamically extended, it is no use for you to 
save the address of some elements.

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



------------------------------

From: Fenglou Mao <[EMAIL PROTECTED]>
Date: Mon, 25 Jan 1999 21:19:28 -0800 (PST)
Subject: overload function question.

Dear all,
     I have a class, for example, CObject, I want statement
like this:

     CObject O1;
//...O1's value is set.
     cout<<O1<<"\n";

     can output the value of O1 using format I wanted.
     How can I do that?

Sincerely Yours,

FengLou Mao
*******************************
ADD:Mr. FengLou Mao
    Peking University
    BeiJing
    P.R.China
Tel:86-10-62751490
Fax:86-10-62751725



------------------------------

From: "Bill cheng" <[EMAIL PROTECTED]>
Date: Mon, 25 Jan 1999 22:48:55 +0800
Subject: GCC compiler principle

This is a multi-part message in MIME format.

- ------=_NextPart_000_004F_01BE48B4.E3696180
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
I am studying compiling principle of C programming, but I have no idea =
where I can start with. For example, how can it parse the text input by =
a user?
To make the problem clearer, I will take an example. Say you have an =
expression, like "(a<1.5) OR (b=3D'abc') AND (2 of (c>0, NOT(d>1), =
(e=3D'cde') AND (f+g*h/i<1))......". (the expression: 2 of (c>0, =
NOT(d>1), (e=3D'cde') AND (f+g*h/i<1) means when 2 expressions in the =
brackets are true, the expression is true). When input by user, those a, =
b, c,d will be replaced by real value, like "(1<1.5) OR ('cde'=3D'abc') =
AND (2 of (1>0, NOT(5>1), ('cde'=3D'cde') AND (4+8*2/3<1))". You must =
compute the result of the expression. Do you know what I mean?
What I want to know is whether you could kindly give me some =
enlightenment. I really do not know what technique to use to parse the =
expression, and how to use some data structure to compute the result, =
(using a linked list, or something else, and also paying attention to =
the priority of the operator.)
Any real implementation or information resource will be appreciated.


Bill Cheng


- ------=_NextPart_000_004F_01BE48B4.E3696180
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hello,<BR>I am studying compiling =
principle of C=20
programming, but I have no idea where I can start with. For example, how =
can it=20
parse the text input by a user?<BR>To make the problem clearer, I will =
take an=20
example. Say you have an expression, like &quot;(a&lt;1.5) OR =
(b=3D'abc') AND (2=20
of (c&gt;0, NOT(d&gt;1), (e=3D'cde') AND (f+g*h/i&lt;1))......&quot;. =
(the=20
expression: 2 of (c&gt;0, NOT(d&gt;1), (e=3D'cde') AND (f+g*h/i&lt;1) =
means when 2=20
expressions in the brackets are true, the expression is true). When =
input by=20
user, those a, b, c,d will be replaced by real value, like =
&quot;(1&lt;1.5) OR=20
('cde'=3D'abc') AND (2 of (1&gt;0, NOT(5&gt;1), ('cde'=3D'cde') AND=20
(4+8*2/3&lt;1))&quot;. You must compute the result of the expression. Do =
you=20
know what I mean?<BR>What I want to know is whether you could kindly =
give me=20
some enlightenment. I really do not know what technique to use to parse =
the=20
expression, and how to use some data structure to compute the result, =
(using a=20
linked list, or something else, and also paying attention to the =
priority of the=20
operator.)<BR>Any real implementation or information resource will be=20
appreciated.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Bill =
Cheng<BR></FONT></DIV></BODY></HTML>

- ------=_NextPart_000_004F_01BE48B4.E3696180--


------------------------------

From: Burak Serdar <[EMAIL PROTECTED]>
Date: Mon, 25 Jan 1999 20:19:49 -0500
Subject: Re: GCC compiler principle

It is quite impossible to give a tutorial on parsing in an e-mail. You
should fist express your grammar in a formal way. The most popular
formalism for expressing context-free grammars is BNF. This grammar
defines how each construct in the language is constructed. Then you
should define semantic actions for each construct. If you want a realy
quick and dirty start, you can check the bison info file. bison is a
parser generator from an attributed grammar definition. The info file
can give you some idea on how to parse such simple grammars. If you use
it, you will also need to use lex (or flex), the lexical analyzer
generator. But if you want to learn the theory, you should read about
finite automata, languages and regular expressions.
If you don't want to learn the theory, you should read something about
these anyway.

Bill cheng wrote:

>  Hello,
> I am studying compiling principle of C programming, but I have no idea
> where I can start with. For example, how can it parse the text input
> by a user?
> To make the problem clearer, I will take an example. Say you have an
> expression, like "(a<1.5) OR (b='abc') AND (2 of (c>0, NOT(d>1),
> (e='cde') AND (f+g*h/i<1))......". (the expression: 2 of (c>0,
> NOT(d>1), (e='cde') AND (f+g*h/i<1) means when 2 expressions in the
> brackets are true, the expression is true). When input by user, those
> a, b, c,d will be replaced by real value, like "(1<1.5) OR
> ('cde'='abc') AND (2 of (1>0, NOT(5>1), ('cde'='cde') AND
> (4+8*2/3<1))". You must compute the result of the expression. Do you
> know what I mean?
> What I want to know is whether you could kindly give me some
> enlightenment. I really do not know what technique to use to parse the
> expression, and how to use some data structure to compute the result,
> (using a linked list, or something else, and also paying attention to
> the priority of the operator.)
> Any real implementation or information resource will be
> appreciated.  Bill Cheng




------------------------------

End of linux-gcc-digest V1 #359
*******************************

To subscribe to linux-gcc-digest, send the command:

        subscribe linux-gcc-digest

in the body of a message to "[EMAIL PROTECTED]".  If you want
to subscribe something other than the account the mail is coming from,
such as a local redistribution list, then append that address to the
"subscribe" command; for example, to subscribe "local-linux-gcc":

        subscribe linux-gcc-digest [EMAIL PROTECTED]

A non-digest (direct mail) version of this list is also available; to
subscribe to that instead, replace all instances of "linux-gcc-digest"
in the commands above with "linux-gcc".

Reply via email to