- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any compiler option for Intel C++ 17.0 which will show me the expansion of a preprocessor macro step-by-step when compiling a source file ?
I know that I can compile a complete source file's preprocessor output to a file, but I need to see each macro expansion step for a particular macro expansion of a source file to determine why the compiler is not expanding the macro properly.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you are using linux, you can use -
icc -dM -E source.c
For windows:
icl /QdM /E source.c
Please let me know if it works.
Thanks,
Varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The dump macros option just dumps the macros -- it will not show you the macro expansions.
We do not have a switch that will show macros being expanded.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Linux, you can get the sources to the C preprocessor. You can modify that to emit the macro line before and as it expands.
Someone may have done this, a little googling might find it.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jimdempseyatthecove wrote:
On Linux, you can get the sources to the C preprocessor. You can modify that to emit the macro line before and as it expands.
Someone may have done this, a little googling might find it.
Jim Dempsey
Currently I am working with Intel C++ 17.0 on Windows. But even if I were working with Intel C++ on Linux I would have to rebuild the compiler. Both gcc and clang have ways to show a macro expansion so I was hoping Intel C++ would have it also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-E -P work similarly with icc as with g++.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim P. wrote:
-E -P work similarly with icc as with g++.
AFAIK -E -P shows complete macro expansion. I am looking for a means of showing step-by-step macro expansion for a particular macro.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page