Preprocessor regression in build 3950

yoriz  

There appears to be a regression in build 3950 (14 Sep 2023) in the behavior of the preprocessor. The code below compiles without errors on the old build 3802 (9 Jun 2023):

#define NAME(prefix, linenr)     prefix##linenr
#define MAKE_VAR \
   int NAME(example, __LINE__) = 123

void OnStart() {
   MAKE_VAR;  // int example6 = 123;
   MAKE_VAR;  // int example7 = 123;
}

However, when compiling this same code in build 3950, I get an error message:

'example__LINE__' - variable already defined
   see declaration of variable '"void OnStart()"::example__LINE__'

Unfortunately, I use preprocessor concatenation ## a lot in my code so all my experts and indicators are now broken and don't compile anymore...

I filed a bug report here: https://www.mql5.com/en/forum/628/page112#comment_49409863 (because Service Desk chat-bot did not understand me and was not filing a bug)

Get in touch with developers using Service Desk!
Get in touch with developers using Service Desk!
  • 2023.07.17
  • www.mql5.com
Any new software inevitably contains bugs that are not always possible to detect even under the most rigorous in-house testing...
Reason: