You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed this while calling wifi_prov_mgr_init() that for some reason takes is argument by value, and its argument sizeof(wifi_prov_mgr_config_t) == 44.
But it can be seen with this simple code:
struct data {
int x[6];
};
void foo(struct data a) {
for (int i = 0; i < sizeof(a) / sizeof(a.x[0]); ++i)
printf("%2d: %d\n", i, a.x[i]);
}
If I compile this code with CLang and call it from CLang, all is well. But if I compile it with GCC and call it from CLang, it prints garbage values.
If I reduce the x[6] to x[4] it works as expected.
But if I change the int x[4] to char x[4] it breaks in a different way, as if there were padding bytes between the elements of the array.