[gnu.g++.bug] union problems

ken@CS.ROCHESTER.EDU (Ken Yap) (01/24/89)

BUG REPORT

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

sun 3-50, Sun Unix 3.4

Summary:

Does not report name clash resulting from member of unnamed union.
Last reported in 1.25.1.

g++ version 1.32

---------------------------

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

main()
{
	foo		bar;

	bar.i = "Hello";
	bar.i = 42;
}

g++ version 1.32.0
 /usr/su/lib/gcc-cpp+ -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix bug5.cc /tmp/cca00711.cpp
GNU CPP version 1.32.0
 /usr/su/lib/gcc-c++ /tmp/cca00711.cpp -quiet -dumpbase bug5.cc -noreg -version -o /tmp/cca00711.s
GNU C++ version 1.32.0 (68k, MIT syntax) compiled by CC.
In function int main ():
bug5.cc:14: warning: assignment of integer from pointer lacks a cast
 as -mc68020 /tmp/cca00711.s -o bug5.o
 /usr/su/lib/gcc-ld++ -C /usr/su/lib/crt0+.o /lib/Mcrt1.o bug5.o -lg++ /usr/su/lib/gnulib+ -lc