[Bug c++/26670] New: attribute((packed)) sometimes not ignored for non-PODs

debian-gcc at lists dot debian dot org gcc-bugzilla@gcc.gnu.org
Mon Mar 13 23:11:00 GMT 2006


[forwarded from http://bugs.debian.org/356548]

Under some circumstances, non-PODs are not properly stripped of their
packedness:

struct nonpod {
    nonpod();
};

struct nonpod_pack {
    nonpod n;
} __attribute__ ((packed));

struct nonpod_pack2 {
    nonpod_pack p;
} __attribute__ ((packed));

gives

foo.cc:6: warning: ignoring packed attribute on unpacked non-POD field 'nonpod
nonpod_pack::n'

nonpod_pack2::p should also have the packedness ignored, since it is a non-POD.


-- 
           Summary: attribute((packed)) sometimes not ignored for non-PODs
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26670



More information about the Gcc-bugs mailing list