Question unused function parameter data garbage collection

2022-09-12 Thread Fredrik Hederstierna via Gcc
Hi, We have a function that does not used an in-parameter, simplified example: void test_unused_string_param_gc(const char* unused) { // empty } Though when we have calls to this function, the arguments are still put in the memory, causing unnecessary flash memory usage for 'dead parameters'

Question about missing array bounds check

2021-09-15 Thread Fredrik Hederstierna via Gcc
I have a question about array index bounds check that I do not fully understand. Compiling the code below, I get warnings for out-of-bounds in one case, but not the other, also printf output gets different, but should be same? Maybe someone can explain what is going on, and if observed behavior is