
On 3/1/21 11:25 PM, Andre Przywara wrote:
On Mon, 1 Mar 2021 18:47:26 +0530 Amit Tomar atomar25opensource@gmail.com wrote:
Hi,
So this whole mode handling here looks dodgy. Below you mix "assignments to mode" with "ORing in values", without actually ever initialising mode explicitly. I wonder why the compiler doesn't warn about this, I can see paths were you OR into an uninitialised value.
But the compiler already has initialized mode to 0,
Why? Where? I just see a local, non-static definition of mode, meaning it won't be initialised.
It seems that it doesn't initialize in this function. I think that resp_type may be always matched one of condition. I think that's why the compiler doesn't warn.
Best Regards, Jaehoon Chung
that is why there is no warning. In order to test , printed out mode value which suggests this variable is initialized.
To what? Just because you printed 0(?) in your test doesn't mean that this will always be the case.
Cheers, Andre