This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23833] warning: "ignoring packed attribute on unpacked non-POD field" on templates
- From: "Dmitry dot Chepel at acronis dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2005 13:47:00 -0000
- Subject: [Bug c++/23833] warning: "ignoring packed attribute on unpacked non-POD field" on templates
- References: <20050912134330.23833.Dmitry.Chepel@acronis.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Dmitry dot Chepel at acronis dot com 2005-09-12 13:46 -------
#include <iostream>
template<typename D, typename W>
struct GuidTemplate
{
char kk;
D TimeLow;
W TimeMid;
W TimeHiAndVer;
union
{
char ClkSeqAndNodeArray[8];
long long ClkSeqAndNodeQword;
struct
{
char ClkSeqHiAndVariant;
char ClkSeqLow;
char Node[6];
};
};
GuidTemplate() {}
} __attribute__ ((packed));
typedef GuidTemplate<long, short> LeGuid;
struct PartitionEntry
{
LeGuid PartitionTypeGuid; // Unique ID that defines the purpose and type of
this Partition.
// A value of zero defines that this partition
// record is not being used.
LeGuid UniquePartitionGuid;// GUID that is unique for every partition
record. Every
// partition ever created will have a unique GUID.
This
// GUID must be assigned when the GUID Partition
Entry
// is created. The GUID Partition Entry is created
when
// ever the NumberOfPartitionEntries in the
// GUID Partition Table Header is increased to
include a
// larger range of addresses.
//le_qword StartingLba; // Starting LBA of the partition defined by this
record
///le_qword EndingLba; // Ending LBA of the partition defined by this
record
//le_qword Attributes; // All bit EFI Reserved
//le_word PartitionName[GPT_PARTITION_NAME_LENGTH]; // Human readable
Unicode string identification
} __attribute__ ((packed));
int main()
{
PartitionEntry entry;
std::cout << "sizeof structute LeGuid = " << sizeof(LeGuid) << "\n";
std::cout << "sizeof structute PartitionEntry = " << sizeof(PartitionEntry) <<
"\n";
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23833