#include <stdio.h>
#include <string.h>
#include <stdint.h>
int main(void)
{
typedef struct
{
uint8_t tolerance;
char footprint[24];
char value[24];
char comment[100];
char type[24];
uint16_t amountOfElements __attribute__((packed));
} FEEDER_PART_PARAMETER;
FEEDER_PART_PARAMETER FeederPartParameter[34]; // FeederPartParameter[0] is unused.
printf("sizeof tolerance = %u\r\n", sizeof(FeederPartParameter
[2].
tolerance)); printf("sizeof footprint = %u\r\n", sizeof(FeederPartParameter
[2].
footprint)); printf("sizeof value = %u\r\n", sizeof(FeederPartParameter
[2].
value)); printf("sizeof comment = %u\r\n", sizeof(FeederPartParameter
[2].
comment)); printf("sizeof type = %u\r\n", sizeof(FeederPartParameter
[2].
type)); printf("sizeof amountOfElements = %u\r\n", sizeof(FeederPartParameter
[2].
amountOfElements)); printf("sizeof whole struct = %u\r\n", sizeof(FeederPartParameter
[2]));
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPHN0ZGludC5oPgoKaW50IG1haW4odm9pZCkKewoJdHlwZWRlZiBzdHJ1Y3QKCXsKCQl1aW50OF90IHRvbGVyYW5jZTsKCQljaGFyIGZvb3RwcmludFsyNF07CgkJY2hhciB2YWx1ZVsyNF07CgkJY2hhciBjb21tZW50WzEwMF07CgkJY2hhciB0eXBlWzI0XTsKCQl1aW50MTZfdCBhbW91bnRPZkVsZW1lbnRzIF9fYXR0cmlidXRlX18oKHBhY2tlZCkpOwoKCX0gRkVFREVSX1BBUlRfUEFSQU1FVEVSOwoKCglGRUVERVJfUEFSVF9QQVJBTUVURVIgRmVlZGVyUGFydFBhcmFtZXRlclszNF07IC8vIEZlZWRlclBhcnRQYXJhbWV0ZXJbMF0gaXMgdW51c2VkLgoJCgkKCXByaW50Zigic2l6ZW9mIHRvbGVyYW5jZSA9ICV1XHJcbiIsIHNpemVvZihGZWVkZXJQYXJ0UGFyYW1ldGVyWzJdLnRvbGVyYW5jZSkpOwoJcHJp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