3

In my C++ class, I have a private variable defined as

unsigned int _MT;

This worked fine until I tried using the Intel C++ compiler. When I used the Intel compiler (version 15.0.xx) I get the error:

... error: expected an identifier
      unsigned int _MT;
                   ^

Upon closer inspection, I discovered that Intel has a predefined (and proprietary) macro _MT. It's not entirely clear to me what this macro does. I do know that it is only defined for 64-bit architectures—which is pretty much every platform these days.

What danger is there in undefining this macro?

jlconlin
  • 14,206
  • 22
  • 72
  • 105
  • 5
    Probably a duplicate of [What are the rules about using an underscore in a C++ identifier?](http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier) – Shafik Yaghmour Nov 26 '14 at 15:39
  • 2
    I recommend you change your own code. The C++ standard has this to say in `17.6.4.3.2 Global names`: _Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace._ – Iwillnotexist Idonotexist Nov 26 '14 at 15:40
  • 2
    In other words, it's not Intel that's using a proprietary macro, the variable uses a reserved name format – Panagiotis Kanavos Nov 26 '14 at 15:46

1 Answers1

4

Using a variable that starts with an underscore followed by a capital letter is undefined behaviour.

Don't do it.

(I've seen _MT standing for "use multithreaded runtime").

Bathsheba
  • 231,907
  • 34
  • 361
  • 483