What dangers are hidden by defining macros of your own compiler macros?

In my C ++ class, I have a personal 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 found that Intel has a predefined (and proprietary) macro _MT

. I'm not entirely clear on what this macro does. I know it is only defined for 64 bit architectures, which is pretty much every platform these days.

What is the danger in defining this macro?

+3


source to share


1 answer


Using a variable starting with an underscore followed by an uppercase letter is undefined behavior.

Do not do this.



(I've seen what _MT

"use a multithreaded runtime" means).

+3


source







All Articles