Ah, that's good to know! I don't think it would make much of a difference in my use case however as there isn't much special code in sdcc_external_startup anyways. I think we've covered every possibility, so I don't mind if you close this.
Yes, exactly. I've run into this issue while working on a low-level library implementing a protocol using existing vendor libraries. Building my own libsddc.lib seems a bit excessive. For now we will provide the implementation of sdcc_external_startup as source code the user of our library.
_sdcc_external_startup() in library
Well, at least the poor code would be correct ;) And no, we are not talking about...
Using volatile is an excellent suggestion and indeed alleviates the problem. I would...
SDCC optimizes away statement even tough it shouldn't when mixing C with inline assembly
I simplified it a bit further. Also, gcc accepts it ;)
SDCC crashes with segfault on variable initalization