OT arm-gcc hadanka

Miroslav Šinko sinkomiro na gmail.com
Pondělí Prosinec 29 14:42:14 CET 2014


10, 20?

S ARM-ami nerobim, predpokladam defaultne zarovnanie na 4 byty.

miro

On 29.12.2014 13:34, Jan Waclawek wrote:
> arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.8.3 20131129
> (release) [ARM/embedded-4_8-branch revision 205641]
>
> c:/PROGRA~1/ARMTools/launchpad.net_gcc-arm-embedded/bin/arm-none-eabi-gcc
> -c -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb  -I.
> -Wpadded -MD -MP -MF .dep/ch.o.d ch.c -o objdir/ch.o
>
>
> Aka je vysledna hodnota a a b?
>
> wek
>
>
> #include<stdint.h>
>
>    typedef struct __attribute__((packed, aligned(1))) {
>      uint16_t a;
>      union {
>        uint32_t b;
>        uint16_t c[3];
>      };
>    } TBar;
>
>    typedef struct __attribute__((packed)) {
>      TBar a;
>      TBar b;
>    } TFoo;
>
>
> const uint32_t a = sizeof(TBar);
> const uint32_t b = sizeof(TFoo);
>
> int main(void) {
> }
>


Další informace o konferenci Hw-list