Nice find Helge! The gcc_struct attribute might also do it.
typedef struct sample_config {
uint32_t sample_depth;
uint32_t psa;
uint16_t u1;
uint32_t u2;
uint16_t clock_divisor;
} __attribute__((gcc_struct, packed)) sample_config_t;
Rgds
Kevin
On 2021-01-02 22:51, Ray Molenkamp wrote:
I do not have the hardware to test on, but with a "hello world" style program
-mno-ms-bitfield fixes the struct size from 18 back to 16
--Ray
On 2021-01-02 11:19 a.m., Paul Fertser wrote: Hi Helge,
On Sat, Jan 02, 2021 at 06:20:54PM +0100, Helge Kruse wrote: The MXE compiler,
that is used for compiling the Windows version ignores
silently this attribute. This can be verified by a simple "Hello, World"
style program. This is a perfect find! Have you tried compiling with
-mno-ms-bitfield
or with pragma pack?
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel