Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

List predefined macros

eldiener
New Contributor I
1,327 Views

In the Intel C++ Windows compiler is there a compiler command that will output the list of predefined macros to the console window ?

0 Kudos
8 Replies
AbhishekD_Intel
Moderator
1,327 Views

Hi,

There is a flag -dM -E which will give details of all macros. We generally use this flag and specify the empty file in Windows NUL.

You can also get the more detailed information regarding ISO Standard Predefined Macros and some Additional Macros from the below link:

https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-iso-standard-predefined-macros

https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-additional-predefined-macros

All these resources will help you to find the Predefined Macros.

 

Warm Regards,

Abhishek

0 Kudos
eldiener
New Contributor I
1,327 Views

Deshmukh, Abhishek (Intel) wrote:

Hi,

There is a flag -dM -E which will give details of all macros. We generally use this flag and specify the empty file in Windows NUL.

You can also get the more detailed information regarding ISO Standard Predefined Macros and some Additional Macros from the below link:

https://software.intel.com/en-us/cpp-compiler-developer-guide-and-refere...

https://software.intel.com/en-us/cpp-compiler-developer-guide-and-refere...

All these resources will help you to find the Predefined Macros.

 

Warm Regards,

Abhishek

icl -dM -E NUL
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.216 Build 20200306
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.
icl: command line warning #10006: ignoring unknown option '/dM'

NUL
#line 1 "NUL"

Your answer is not working for the Intel C++ Windows compiler.

0 Kudos
AbhishekD_Intel
Moderator
1,327 Views

Hi,

We also got the same error with ICL and ICX compiler and we have reported it to the concerned team.

Thank you for your finding. Meanwhile, you can go through the links that I have provided for getting more information regarding predefined macros.

We will get back to you soon.

 

Warm Regards,

Abhishek

0 Kudos
Viet_H_Intel
Moderator
1,327 Views

Have you tried icl /E test.c?

0 Kudos
eldiener
New Contributor I
1,327 Views

Viet Hoang (Intel) wrote:

Have you tried icl /E test.c?

icl /E test.c
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.216 Build 20200306
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

test.c
Catastrophic error: cannot open source file "test.c"

0 Kudos
Viet_H_Intel
Moderator
1,327 Views

I misunderstood that you wanted to see the macros of your program. You can icl /E /QdM  on a dummy testcase. 

0 Kudos
Viet_H_Intel
Moderator
1,120 Views

Let us know if this is still an issue. Otherwise, we will close it.


Thanks,


0 Kudos
Viet_H_Intel
Moderator
1,095 Views

We will no longer respond to this thread.  

If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.

Thanks,


0 Kudos
Reply