🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Patrick Steranka Sat, 02 Dec 1989 20:10
Bug in g++ (Can't define global variable)
#664
Author: Patrick Steranka
Date: Sat, 02 Dec 1989 20:10
51 lines
2388 bytes
>From uunet!lurch.Stanford.EDU!tiemann Thu Nov 30 14:52:28 1989
>Date: Thu, 30 Nov 89 10:48:10 PST
>From: uunet!lurch.stanford.edu!tiemann (Michael Tiemann)
>To: patrick@cos.com
>Subject: Can you define global variables that are of a type "class"
>
>Send me the code that causes the error, and tell me what machine you
>are using.  And yes, you should send GNU C++ bug reports to
>bug-g++@prep.ai.mit.edu.  

Michael, et al.,

	I have found a bug and want to report it.  The bug is:
"You can't define global variables in C++, but you should be able to."
The bug can be reproduced as follows:

==============================   File: ex5.cc  ==============================
#include <stream.h>
#include <String.h>

String astring;
 
main(int argc, char* argv[])
{
 
    astring = "This is a test";
    cout << "astring = " << astring << "\n";
}
==============================   File: ex5.cc  ==============================

This was compiled on a SUN 3/280 running SUN OS 3.5.
Here is the output from the compilation:

cd /usr.MC68020/zulu/patrick/test/c++/
make -k ex5
g++ -o ex5 -g -v ex5.cc
gcc version 1.36.1- (based on GCC 1.36)
 /usr/local/lib/gnu/gcc/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 ex5.cc /usr/tmp/cca21637.cpp
GNU CPP version 1.36
 /usr/local/lib/gnu/gcc/gcc-cc1plus /usr/tmp/cca21637.cpp -quiet -dumpbase ex5.cc -g -version -o /usr/tmp/cca21637.s
GNU C++ version 1.36.1 (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
 as -mc68020 -o ex5.o /usr/tmp/cca21637.s
as: error (/usr/tmp/cca21637.s:568): Invalid operand
as: error (/usr/tmp/cca21637.s:595): Invalid operand
g++: ex5.o: No such file or directory
*** Error code 1
make: Fatal error: Target `ex5' not remade because of errors

Compilation exited abnormally with code 1 at Sat Dec  2 15:02:45
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