When are pad bytes copied - struct assignment, pass by value, other?
问题 While debugging a problem, the following issue came up. (Please ignore minor code errors; the code is just for illustration.) The following struct is defined: typedef struct box_t { uint32_t x; uint16_t y; } box_t; Instances of this struct are being passed by value from function to function (obviously simplified): void fun_a(box_t b) { ... use b ... } void fun_b(box_t bb) { // pass bb by value int err = funa(bb); } void fun_c(void) { box_t real_b; box_t some_b[10]; ... ... use real_b and some