Hi I have a question about a compiler warning.
See 
Customer reports:
#548-D transfer of control bypasses initialization of: sl_selftest.c /MonacoSC/BSP/SafetyLibrary/source line 162 C/C++
Googling for explanations of this warning I found 
Which I think I understand and also understand that by putting the initialized variable inside {} under the case statement, this is safe now because if that variable is used outside the {} now it would be out of scope and you'd actually get an error instead of a warning.
Mainly, I first want to check w. the compiler experts that this is a correct explanation and also confirm that it applies to both C and C++. (some other explanations talk about this being a requirement of the C++ standard...)
Now assuming that explanation is correct the workaround suggested would be to put { } around the code in every case (kind of a brute force solution).
But let's say we wanted to find the actual offending case .. aside from putting {} around each case and then removing until the error comes back - is there any way that the compiler can help by showing which case causes the issue. It seems to be referring to the line with the 'switch()' but there's a ton of cases under that switch and the code is very difficult to read IMO :( .. I looked for something that might be the offending line but didn't spot it.
The code throwing the warning in question is the attached file: and searching for 'false warning' should take you to right above the switch statement...
Mainly looking for some expert advice on this problem because the code is part of the safety library and because of that I think the customer is especially concerned about making sure that it compiles cleanly without warnings - so want to give the best (correct) advice possible here and not just something that makes the warning disappear for the wrong reason...