Made me recall this article on why the 6502 isn't great as a C target, including a follow up with some pointers on avoiding some issues with it.
Yeah, it’s better to use a “high-level” language designed for the architecture, such as this: https://github.com/dschmenk/PLASMA