Hello,
I am working on AT91SAM9G20, Keil 5.10. I am passing a constant structure pointer to a function.
typedef struct { int Test; int OkFlag; }StructNode; typedef const StructNode *const Node_t
after passing the node 3 times recursively through a function
stack data is getting corrupted.
Am I doing any mistake, Please suggest.
Passing an address of a stack based variable can be tricky since the lifetime of the variable ends at the function return.
When the reference pointer of such a variable is used after that, you get a stack corruption. I suggest that you analyze your program for such a scenario.