MT5 compiler bug #2 with macros

 

Compile ...

#define STR_TO_BOOL(source) (source=="true" || (int)source!=0)
int OnInit()
  {
  //--- This will produce warning "implicit conversion from number to string
  Print("True: ",STR_TO_BOOL("1"));
  
  //--- This is the same but will not produce any warnings
  Print("True: ",("1"=="true" || (int)"1"!=0));
  
  
  return(INIT_SUCCEEDED);
  }
 
I get this warning with build 1995 but not with 2025.
 
  1. Why did you post your MT5 question in the MQL4 section, (bottom of the Root page?)

  2. Your code compiles just fine in MT4/1170/strict
    'testscr.mq4'    testscr.mq4    1    1
    0 error(s), 0 warning(s), compile time: 3421 msec        1    1


 
William Roeder:
  1. Why did you post your MT5 question in the MQL4 section, (bottom of the Root page?)

  2. Your code compiles just fine in MT4/1170/strict

Why do you answer with MT4 when I mentioned MT5? I am sure an admin can move this easily. 

 
Doerk Hilger:

Compile ...

Forum on trading, automated trading systems and testing trading strategies

MT5 compiler bug #1 with macros

Alain Verleyen, 2019.05.02 17:56

It compiles just fine with beta build 2025.

As usual the release build (2007) has a lot of bugs, the beta solves some of them but has others.


 
Doerk Hilger: Why do you answer with MT4 when I mentioned MT5? I am sure an admin can move this easily. 

Because you posted in the MT4 forum. Why do you post in the wrong place?

 

I am one of these persons who make mistakes sometimes, I am proud on you that you dont seem to be one of those. Congrats to the forum-police-department ;)