Complete
over 2 years ago

Issue resolved and should be implemented soon.

monkey c build error

I'm sorry, I've just click delete by accident and post was deleted.

So I repeat, code:

this code
        var x=2, y;
        switch(x)
        {
            case 1:
                y=1;
                break;
            case 2:
            default:
                y=2;
        }
        func(y, y, y, y);


generetes BUILD: ERROR: ...:  Variable y may not have been initialized in all code paths.
NOT TRUE, because there is default statement an  y is always initialised after switch

similar code:

var x=2, y;
        switch(x)
        {
            case 1:
                y=1;
                break;
            case 2:
                y=2;
                break;            
            default:
                y=2;
        }
        func(y, y, y, y);

is for compiler ok.

I know how to cope with this, I've only announced error, Garmin decides if it should be correct or not.

Parents Comment Children
No Data