tags:

views:

32

answers:

1

I'm getting these analyzer warnings, are they due to goto statements ?

alt text

--- snip ---

alt text

+1  A: 

That's because strDesc is defined before the WarningMessage label.

So even if you shouldn't be in that case (second branch of IF after WarningMessage + strDesc undefined), you should declare strDesc after WarningMessage.

Francois B.
or before the `goto`.
KennyTM
Ah that solved it but the next line as the error now. That lines variable formatedDBStartDate is assigned further up and is going to be messy to move. Whats the answer not to use goto's ?
Jules
The answer is to put the assignments for your variables in a place that is actually executed. Your goto statement jumps right over it - that's what goto is there for. You still get the declaration of the variables inbetween, but any assignment or otherwise executing code does not get executed.
Eiko
Ah I see now, you'd think that would be an error not a warning.
Jules