I'm not sure if it is a bug, but I could not find any hint in the documentation that the -Cl option comes with the limitation of recursive calls. An example
#include <stdint.h>
#include <stdio.h>
void caller(uint8_t param)
{
uint8_t x = param - 1;
if (x == 0) return;
caller(x);
printf("%u ", x);
}
int main(void)
{
caller(10);
return 0;
}
This should produce the output 1 2 3 4 5 6 7 8 9 correct without -Cl option. But if enabled the output is 0 0 0 0 0 0 0 0 0. The option itself does to do what expected, just the value of the deepest recursion call is the output. But I think there should be at least a big warning in the documentation and --help option.
Thanks for reading and have fun,
Dirk =D
https://cc65.github.io/doc/cc65.html#ss2.2 says "[...] the code is no longer reentrant."
Maybe just adding the word recursion for the sake of clarity?
https://stackoverflow.com/questions/3052393/reentrancy-and-recursion
https://github.com/cc65/cc65/commit/8e685a00717348d5b1af9cac180269b15fa25b71 :-)
Thanks. It麓s really better for everyone :)
Greets and happy weekend xD
Most helpful comment
https://github.com/cc65/cc65/commit/8e685a00717348d5b1af9cac180269b15fa25b71 :-)