🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by sdm Fri, 26 May 1989 18:37
g++ bug
#2034
Author: sdm
Date: Fri, 26 May 1989 18:37
24 lines
1201 bytes
Consider the following program:

    #include <stream.h>

    class C { public: int x = 5; };

    main(){
      C foo;
      cout << foo.x << "\n";
     }

This compiles without warnings or errors under g++ 1.34.2 on a sun3 or sun4
running SunOS Release 4.0.  When I run the program, however, the value
printed out is not 5.  On the sun4 it's 0, and on the sun3 it's 251656748.
I'd prefer to see either a compiler error or correct execution :-).

Since I'm not in charge of installing the compiler, I'm not sure what the
names of the files 'tm.h' and 'md' were during installation, but I did poke
around in the installation directory, and files with those names exist
there.  If you can't do anything without the names of those files, let me
know, and I'll find out what was used during installation.

Scott Meyers
sdm@cs.brown.edu
Re: g++ bug
#2035
Author: Doug Schmidt
Date: Fri, 26 May 1989 19:52
25 lines
1399 bytes
In article <8905261837.AA02121@sundry.cs.brown.edu> sdm@CS.BROWN.EDU writes:
++ Consider the following program:
++ 
++     #include <stream.h>
++ 
++     class C { public: int x = 5; };
++ 
++     main(){
++       C foo;
++       cout << foo.x << "\n";
++      }
++ 
++ This compiles without warnings or errors under g++ 1.34.2 on a sun3 or sun4
++ running SunOS Release 4.0.  When I run the program, however, the value
++ printed out is not 5.  On the sun4 it's 0, and on the sun3 it's 251656748.
++ I'd prefer to see either a compiler error or correct execution :-).

This appears to be fixed in version 1.35.

Doug
--
On a clear day, under blue skies, there is no need to seek.
And asking about Buddha                +------------------------+
Is like proclaiming innocence,         | schmidt@ics.uci.edu    |
With loot in your pocket.              | office: (714) 856-4043 |
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads