Hello Jacob,

On an 8-bit processor structs usually are by packed by design as there is
no reason for interspersed bytes to overcome alignment drawbacks. As such
SDCC has no packing options/pragmas/language extensions.

Maarten

> Hello,
>
> I am fond of using __attribute__((packed)) to document register
> definitions
> in this manner:
>
> typedef struct BitField {
> bool b7;
> bool b6;
> bool b5;
> bool b4;
> bool b3;
> bool b2;
> bool b1;
> bool b0;
> } __attribute__((packed)) BitField;
>
> Would I expect sdcc to generate packed structs without the attribute in
> this case? -fpack-struct=1 is unsupported, and __attribute((packed))__
> presents a syntax error.
>
> Thanks for pdk15 support!
> Jacob
>
> --
> @jakej




_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to