

If you run into any bugs, we would appreciate if you can file a bug report via Help > Send Feedback > Report A Problem from the IDE. 15.8 Preview 1 is available today, and you will find even more new features in future previews. When hovering on a macro that is used as an argument to a function-like macro (you can still hover on the function-like macro name itself instead though).Īs always, we encourage you to try out the newest features via the Visual Studio 2017 Preview channel.On the condition blocks of #if / #ifdef statements.The following are a few cases where you will not yet see macro expansions: Since this feature is still in preview, there are a few limitations which we plan to address in a future update. You can download the latest preview build of Visual Studio that can run side by side with your release build from the Visual Studio website. This feature is available today in the first 15.8 preview.
#In expansion of macro in c full#
But when you have a macro that references other macros, getting the full expansion easily can save you a lot of time. Hovering over a macro now shows the expansion of that macro.įor a very simple macro, like a macro defining a constant number such as Pi, this might not seem very useful, since the macro definition alone will tell you all you need to know. As of Visual Studio 2017 version 15.8, when you hover over a macro, you get an additional line of information: the actual expansion of the macro that the preprocessor will replace during the first stage of compilation.
#In expansion of macro in c code#
If you are already using Visual Studio, you may already know that you can hover over a code symbol (such as a variable) to quickly see the definition of that symbol, as well as any comments describing it (as long as those comments are present above the definition).

To make it easier to understand what a particular macro is doing, we are introducing a new feature: macro expansions in Quick Info tooltips. Macros are always a pain to deal with, yet they are one of those things that never seem to go away in C++. When hovering on a macro that is used as an argument to a function-like macro (you can still hover on the function-like macro name itself instead though). On the condition blocks of if / ifdef statements. A good way to do this is to look at C/C++ language features that are difficult to work with, and make it easier to understand them. The following are a few cases where you will not yet see macro expansions: On define statements. With Visual Studio, we’re always looking for ways to save developers time and make them more productive.
