Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!CS.ROCHESTER.EDU!ken From: ken@CS.ROCHESTER.EDU (Ken Yap) Newsgroups: gnu.g++.bug Subject: more unnamed union problems Message-ID: <8810110316.AA29356@cursa.cs.rochester.edu> Date: 11 Oct 88 03:16:50 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 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