I'm using Visual Studio 2005 (32-bit) on a Windows XP system. I've got a C++ project that I build from the command line (in a batch file) that uses devenv.exe to launch the build. Here's an example of how it gets launched:
{path_to_devenv.exe} my_solution.sln /rebuild "Debug|Win32" /out my_logfile.txt
Within the code for this project, we use a few pragma statements to disable some extraneous warnings that we don't want to see:
#pragma warning ( disable : 4521 4522 )
// Some code here
#pragma warning ( default : 4521 4522 )
When the project is built in the debug configuration from the IDE, these warnings do not show up in the build output. When the same project is built from the command line, the warnings do show up in our log file (which we specified with the /out command line parameter). When building in release, the warnings do not show up in either case.
Is there something different about driving VS 2005 through devenv.exe that causes the pragma to be ignored in the debug case? Why should these warnings show up in one world and not the other?
Frankly the only reason I can see this happening is when the pragmas aren't seen.
Check
Debug|Win32 from within the IDE too?)If you are desperate for clues, you can always keep the result of preprocessing using both variants and compare them. The 'keep preprocessed source' option is hidden somewhere under the 'Preprocessor' C++ build settings.
Good luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With