I tried c++ on www.repl.it
and it throws a warning:
clang++-7 -pthread -std=c++17 -o main main.cpp main.cpp:6:11: warning: if statement has empty body [-Wempty-body] if (0); ^ main.cpp:6:11: note: put the semicolon on a separate line to silence this warning 1 warning generated. ./main Hello, world!
after searching closely into the messages of the mql5 compiler,
such a warning is there too, but it's lost in the maze of lots of "declaration" warnings
(it would be super cool if we could check / uncheck what warnings to see or hide
if (0){}; printf("stuff"); //will get printed, because the ";" above
It differs from this
if (0){ printf("stuff"); };
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I made a simple mistake to write unknowingly a ";" after an if condition,
it took me a lot of time to realize that mql5 permits it, and considers it valid
It should appear as an error in code,
I don't see any potential use of permitting a ";" after the if condition
I don't know if it's a bug though, I don't know if c++ accepts it or not
But I thought it would be well to write this issue at least, here