Re: C++ 3.4.5 packed reference warning

2005-12-07 Thread Nathan Sidwell
Steven L. Zook wrote: I guess what I don't understand is why struct A isn't POD. A reference to something is basically just a pointer. It has no alignment restrictions that a pointer wouldn't. a reference type is not a pod type because the language says so. nathan -- Nathan Sidwell:: ht

RE: C++ 3.4.5 packed reference warning

2005-12-07 Thread Steven L. Zook
Sent: Wednesday, December 07, 2005 8:03 AM To: Steven L. Zook Cc: gcc@gcc.gnu.org Subject: Re: C++ 3.4.5 packed reference warning Steven L. Zook wrote: > When I compile this using gcc rev 3.4.5 (m68k-elf): > > struct A { charB; >unsigned char & C; } __attribute_

Re: C++ 3.4.5 packed reference warning

2005-12-07 Thread Nathan Sidwell
Steven L. Zook wrote: When I compile this using gcc rev 3.4.5 (m68k-elf): struct A { charB; unsigned char & C; } __attribute__((packed)); unsigned char D; A E = { 'F', D }; I get: testpp.cpp:2: warning: ignoring packed attribute on unpacked non-POD field `unsigned char&A

C++ 3.4.5 packed reference warning

2005-12-06 Thread Steven L. Zook
When I compile this using gcc rev 3.4.5 (m68k-elf): struct A { charB; unsigned char & C; } __attribute__((packed)); unsigned char D; A E = { 'F', D }; I get: testpp.cpp:2: warning: ignoring packed attribute on unpacked non-POD field `unsigned char&A::C' sizeof( E ) == 6