🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by kenneth baclawski Wed, 04 Oct 1989 00:28
(none)
#463
Author: kenneth baclawski
Date: Wed, 04 Oct 1989 00:28
32 lines
1480 bytes
/*
     Problem with stream output of class objects in GNU C++

Compilation:

g++ -v output_bug.c -o output_bug
g++ version 1.35.1-
 /kens-disk/k/gnu/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 output_bug.c /tmp/cca01249.cpp
GNU CPP version 1.35
 /kens-disk/k/gnu/lib/gcc-cc1plus /tmp/cca01249.cpp -quiet -dumpbase output_bug.c -noreg -version -o /tmp/cca01249.s
GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.
 as -mc68020 /tmp/cca01249.s -o output_bug.o
 /kens-disk/k/gnu/lib/gcc-ld++ -o output_bug -C -e __start -dc -dp /kens-disk/k/gnu/lib/crt0+.o /kens-disk/k/gnu/lib/Mcrt1.o output_bug.o -lg++ /kens-disk/k/gnu/lib/gcc-gnulib -lc

Execution (on a Sun-3/75 running SunOS 4.0):

output_bug
B
AB

*/

#include <stream.h>

struct X {
  char a[2];
  X() { a[0] = 'A'; a[1] = '\0'; }
};

ostream& operator<< (ostream& out, X s) { return out << s.a; }

main() { X s; cout << "B\n"; cout << s << "\n"; }
Re: (none)
#467
Author: Doug Schmidt
Date: Wed, 04 Oct 1989 04:47
19 lines
1164 bytes
In article <8910040028.AA01289@flora.CCS.Northeastern.EDU>, kenb@flora (kenneth baclawski) writes:
>/*
>     Problem with stream output of class objects in GNU C++

g++ 1.36.0- prints

% /usr/gnu/g++ -O outbug.cc -lg++
% a.out
B
A

on a sun 3 and sun 4.

Doug
--
schmidt@ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.
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