Invalid parameters warning in integration tests

But I really can’t see how it is happening, because what the debugger shows me makes no sense to me.

So, I noticed that when the firmware runs its integration tests I get see this

“init”:ruuvi_nrf5_sdk15_communication_ble_gatt.c:718 WARNING: INVALID_PARAM

Now further investigation showed me that when the code reaches this line
err_code |= gap_params_init();
err_code is (according the debugger) equal to zero, but after it, it equals 7… so obvious conclusion, there’s an invalid parameter in gap_params_init()

But then when I look at gap_params_init(), firstly I fnd that the parameters all seem to be in spec according to the docs, but more confusingly, according to the debugger, the err_code value it returns is 0!

Now unless I’ve slipped through into a parallel dimension without noticing 0 | 0 = 0, so what is going on here?

Also, as an aside, does the compiler do optimizations even when it is set to none? There seem to be an awful lot of lines of code where I can’t set a breakpoint in a debug build.

If I recall correctly, debug build is size-optimized in RuuviTag build because of flash size limitation. It makes debugging somewhat painful.