drmortalwombat / oscar64

Optimizing Small memory C Compiler Assembler and Runtime for C64
GNU General Public License v3.0
261 stars 21 forks source link

Missing features/defines like `goto` or `NULL`. #69

Closed everslick closed 2 months ago

everslick commented 2 months ago

If this is missing on purpose, then it should maybe be documented in the README?

Cheers!

drmortalwombat commented 2 months ago

NULL Is defined in stddef.h - and yes "goto" is missing on purpose. If there is demand for a goto, I will look into it.

everslick commented 2 months ago

thx, I missed the stddef.h include.

I find goto very helpful for function cleanup code and early exit from nested loops. I'm aware that many find this 'unclean'. Nevertheless it's in the language so I vote for including it. ;-)

drmortalwombat commented 2 months ago

While goto is quite trivial in C, it is complex in C++ due to the constructor/destructor requirementes when entering/leaving scopes, so it may be a while before I muster the courage to implement it.

drmortalwombat commented 2 months ago

Added goto as keyword with an unimplemented error message

Kopromaster commented 2 months ago

NULL Is defined in stddef.h - and yes "goto" is missing on purpose. If there is demand for a goto, I will look into it.

Although I normally don't use goto in manually written code, it's very useful for generated sources, so I'd appreciate it too :-)

drmortalwombat commented 2 months ago

Added goto with latest check in (including destructor invocation in C++), please test.

everslick commented 2 months ago

Thanks. Will do so. May take until friday though.

everslick commented 2 months ago

Tested and works -> closing. Thank you for your great work!