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
initialization uses store to load the initial value, but store only loads the first two bytes, so the rest of the struct is left uninitialized.
typedef struct {
char a, b;
int c;
} Ty2;
Ty2 foo = { 1, 2, 3 }; // only initializes a and b (first two bytes), c left uninitialized
Ty2 bar; bar = { 4, 5, 6 }; // assignment works though
just documenting this here in case i forget to circle back to it, ideas for deduplicating assign/store stuff greatly appreciated
The text was updated successfully, but these errors were encountered:
youbitchoc
changed the title
struct initialization only inits first 2 bytes
initialization only inits first 2 bytes
Aug 15, 2024
initialization uses
store
to load the initial value, butstore
only loads the first two bytes, so the rest of the struct is left uninitialized.just documenting this here in case i forget to circle back to it, ideas for deduplicating assign/store stuff greatly appreciated
The text was updated successfully, but these errors were encountered: