[chbot] GCC and recursion

Mark Atherton markaren1 at xtra.co.nz
Fri Mar 29 17:56:41 GMT 2024


All,

Haven't recursed for a number of years, so need some help.

I am building an RPN expression evaluator for the uCPU assembler; I 
can't see any other way to go other than to use recursion to do the 
nested processing that I wish.

Currently using "gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, 
built by Brecht Sanders)"

The first call of the recursed function worked fine, but crashes upon exit.

It could be that the compiler is not generating re-entrant code. The 
only switch I have used is -O0 to disable compiler optimization.

Are there any other switches for GCC that I need to use/be aware of ?

Thanks, Mark



More information about the Chchrobotics mailing list