[gnu.g++.bug] more unnamed union problems

ken@CS.ROCHESTER.EDU (Ken Yap) (10/11/88)

Problem:

Field name clash elicits no error message but first field declaration wins.

Session log:

[oak 20] g++ -v -g -W -c bug5.cc
g++ version 1.25.1
 /u/cs454/lib/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix bug5.cc /tmp/cca23370.cpp
GNU CPP version 1.25.1
 /u/cs454/lib/gcc-c++ /tmp/cca23370.cpp -quiet -dumpbase bug5.cc -W -noreg -version -G -o /tmp/cca23370.s
GNU C++ version 1.25.1 (68k, MIT syntax) compiled by GNU C version 1.25.
In function int main ():
bug5.cc:14: warning: assignment of integer from pointer lacks a cast

Program:

struct foo
{
	union
	{
		int		i;
	};
	char	*i;
};

main()
{
	foo		bar;

	bar.i = "Hello";
}

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