PREfast is a C/C++ static source code analysis tool that comes with Platform Builder for Windows CE/Windows Mobile (for CE5 and WM6) It’s ’static’ because it analyzes source code without actually executing it, unlike dynamic analysis tools like Purify. PREfast performs a similar function to lint although people who use both sometimes find that the two tools uncover different defects. PREfast can be found in the folder %_WINCEROOT\PUBLIC\COMMON\OAK\bin\i386\prefast\scripts.
One directory level up from the tool itself is a filter batch file that defines the PREFAST_DEFECT_FILTER environment variable that filters which warnings will be reported. To run PREfast open a Build window and enter the command ‘prefast build -c’. When the build is complete, you can navigate back to the prefast directory and type ‘prefast view’ to see the list of defects in a graphical UI, or ‘prefast list’ to export them to a text file.
There is also a similar tool for analyzing managed code called PREsharp.
As of Platform Builder for Windows CE 6.0, the tool is not actually included as a separate component, but it is incorporated into the compiler. To enable PREfast-like analysis in these environments set CODE_ANALYSIS=1 in your project settings.