"v later found out with more debugging that it happened because the module in question cast that struct back from memory, and then added its own stuff to it."<p>That's your problem right there: "cast". In C, you can cast things, but doing so breaks the type system, which can no longer help you. That's not the fault of C, that's your fault. You literally asked for it.<p>C is the useful idioms of assembly language made first-class. For fundamental reasons of the universe, C is <i>the</i> programming language. See also: <a href="https://embeddedgurus.com/barr-code/2018/02/c-the-immortal-programming-language/" rel="nofollow">https://embeddedgurus.com/barr-code/2018/02/c-the-immortal-p...</a><p>"This year a portion of my analysis is focused on multi-year trends. One trend that really stands out to me is that the C programming language refuses to give up the ghost.<p>"A longitudinal study of survey data spanning almost a decade and a half shows that C remains the primary programming language of embedded software. Remarkably, in that time C has actually gained market share from 50% to about 70%–at the expense of assembly, C++, and Java."