Bugs report: MetaEditor warning + typedef bug

 

Hello,

I have come lately across two bugs, one regarding a simple warning of MetaEditor when compiling, and another one concerning typedefs.

a) Regarding the compiler warning, when I compile the following example, I get the warning about val "possible use of uninitialized variable 'val'":

        ushort val, valb; 
        bool valbool=true; 
          
        if (valbool) val=5;  
          
        if (valbool) valb=val;

Of course val is initialized in the first "if", since valbool is initialized when declared 

b) Regarding the bug with typedefs, I get various errors with the following example:

void OnStart()
{                
        int val;         
        callback cb, cbb, cbc; 
         
        cb=(val? cbsome: cbsomeb);                      //      this gets errors 
//      cb=(val? (callback)cbsome: cbsomeb);            //      halfway there 
//      cb=(val? (callback)cbsome: (callback)cbsomeb);  //      solution 
         
        cb=(val? cbb: cbc);     //      no problem       
}     
 
        //      // 

typedef void (* callback)(void); 
 
void cbsome(void) { }; 
void cbsomeb(void) { };

In order for the bug to be more obvious, please uncomment one line at a time (of the three packed), the errors should not be there

 

greets
 

Hellom,

Just a heads up, please disregard the warning part of my post, since I realize that the example is not logical so the warning is correct.. Also, I have installed the latest beta (4390) but I am pretty sure that the bugs with the typedefs appeared since the last (non beta) version (still I could not be sure),


greets