IBM® Rational® PurifyPlus™ for Windows works best with programs that are built with certain compiler and linker settings. If you run into problems using PurifyPlus one of the first steps you should take is to determine if you are using the right settings. If you aren't you should correct these settings and then rebuild your program. This script was written to assist you in performing these steps for programs built with Visual Studio .NET, Visual Studio .NET 2003, Visual Studio 2005 and Visual Studio 2008. There is a separate script for programs built with Visual Studio 6.
For more information on the recommended settings please refer to the product's online help, which is available from the product's Help menu. Once the online help is opened, you should view the "Recommended Settings for Visual Studio" topic.
This script can be used to report settings that need to be changed. You can then make these changes yourself via the Visual Studio IDE, or you can optionally tell the script to change those settings and write them to your project files.
Defaults are provided for all values except for either the solution file or project file. It is required to enter one of these.
Here is the syntax.
v1.05 Usage: perl ScanVSSolutionForPurifyPlus.pl [<options>] Options: -sln=<solution-file> ==> specify the solution file to check or modify. You must specify a solution file or a project file. -proj=<project-file> ==> specify the project file to check or modify -config=<ConfigurationName | all> config=ConfigurationName ===> only scan the specified configuration config=all (default) ==> scan all configurations -report=<output file> Specify the output file (default)=output to console -write=<yes> Modify settings and write. It is recommended that you backup the projects before modifying. write=yes ==> modify settings and write project file(s) after saving current project file(s) to.backup. write=no (default)==> report incorrect settings only, don't modify anything. e.g. perl ScanVSSolutionForPurifyPlus.pl -sln="C:\My Apps\MyCode.sln" -report=scan.log -write=yes or perl ScanVSSolutionForPurifyPlus.pl -proj=C:\MyApps\Myproj.vcproj -report=scan.log -write=yes
You can check an entire solution, or focus on a project or configuration or a combination of the two. For example:
Check an entire solution, all projects and all configurations: perl ScanVSSolutionForPurifyPlus.pl -sln=C:\MyApps\MyCode.sln Check just one project, all configurations: perl ScanVSSolutionForPurifyPlus.pl -proj=C:\MyApps\MyCode.vcproj Check just one project and one configuration for that project: perl ScanVSSolutionForPurifyPlus.pl -proj=C:\MyApps\MyProject.vcproj -config=DebugThe script tries to limit it's checks to configurations that we target. Thus the script checks only those configurations that are targeted for the Win32 platform. It also doesn't check unknown project types. The output will list all the projects and configurations that are found, and report what isn't being checked as well as what is being checked.
The script generates a report that lists the files that it checked and the values that weren't set to the recommended values and what the recommended values should be. You can go and manually change these settings in the Visual Studio IDE and run the script again after saving these changes to verify you've made the changes correctly.
If you desire, you can optionally have the script automatically correct the settings and write the files to disk. Follow these instructions before doing this, for safety's sake:
Note that if you rerun the script telling it to write again, we won't create new