conleon / snes-sdk

Automatically exported from code.google.com/p/snes-sdk
0 stars 0 forks source link

__attribute__((packed)) doesn't work #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
struct dma_transfer {
  unsigned short src_addr; /* 0 + 1 */
  unsigned char src_bank; /* 2 */
  unsigned short dest; /* 3 + 4 */
  unsigned short size; /* 5 + 6 */
  unsigned char type; /* 7 */
} __attribute__((packed));

This structure is 10 bytes instead of 8. (Is there a point in aligning
stuff on the 65816 at all?)

Original issue reported on code.google.com by ulrich.h...@gmail.com on 30 Jul 2009 at 7:59

GoogleCodeExporter commented 8 years ago
This is because tcc doesnt support it.

What you can do is to set __attribute__((packed)) on all members of the struct 
to solve it.

Original comment by jens.nyb...@gmail.com on 6 Nov 2013 at 11:44