This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12200] Nonintuitive behavior with __attribute__((packed))


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From rearnsha at gcc dot gnu dot org  2003-09-29 12:52 -------
This is exactly what the specification of packed implies.  If you want a
specific instance of a packed object to be more aligned, then you can add
alignment in its declaration, hence:

extern const short a = 1;

struct TPacked {
  short b;
  short c;
  int d;
} __attribute__((packed));

extern const TPacked e __attribute__((aligned(4))) = { 2, 3, 4 };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]