🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ken Yap Fri, 13 Jan 1989 04:32
reference to array
#1603
Author: Ken Yap
Date: Fri, 13 Jan 1989 04:32
63 lines
1946 bytes
Problem:

Cannot handle use of reference to array. When offending lines are
commented out, assembler code for initialized data appears to be
correct.  Is this fixed in 1.32? Our local maintainer is somewhat
behind.

Session log:

g++ version 1.25.1
 /usr/su/lib/cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix b.cc /tmp/cca01379.cpp
GNU CPP version 1.25.1
 /usr/su/lib/c++ /tmp/cca01379.cpp -quiet -dumpbase b.cc -noreg -version -o /tmp/cca01379.s
GNU C++ version 1.25.1 (68k, MIT syntax) compiled by CC.
In function int main ():
b.cc:24: cannot convert to a pointer type
b.cc:24: bad argument 1 for function `ostream::operator << (const char *)' (type was void )
b.cc:24: void value not ignored as it ought to be
b.cc:24: type conversion required for type `ostream'
b.cc:26: cannot convert to a pointer type
b.cc:26: bad argument 1 for function `ostream::operator << (const char *)' (type was void )
b.cc:26: void value not ignored as it ought to be
b.cc:26: type conversion required for type `ostream'

Version and environment:

g++ version 1.25.1

tm.h = tm-sun3.h
md = m68k.md
aux-output.c = output-m68k.c

sun 3-50, Sun Unix 3.4

Program:

#include	<stream.h>

typedef	int	arr[10];

arr	x = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, };
arr&	y = x;

class foo
{
public:
	static const int	i = 10;
	static const arr&	z = x;
		foo();
};

main()
{
	int	i;
	foo	f;

	for (i = 0; i < 10; ++i)
		cout << x[i] << "\n";
	for (i = 0; i < 10; ++i)
		cout << y[i] << "\n";
	for (i = 0; i < 10; ++i)
		cout << f.z[i] << "\n";
}
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