Running PREfast (Windows CE 5.0)

Send Feedback

To execute PREfast, use whatever build command you normally use at the command line, prefaced by the word prefast. Follow the build command with command-specific arguments, as shown in the following command:

prefast <build-command> <command-specific arguments>

PREfast recognizes three standard build commands:

  • cl cl-arguments

    Compiles and runs PREfast on an individual file and prints the PREfast results textually. For example,

    prefast cl /c test.c 
    
  • nmake nmake-arguments

    Performs an Nmake and runs PREfast on all compiled files and prints the PREfast results textually. Any nmake-arguments are passed as arguments to Nmake. For example,

    prefast nmake /f pfw_build.mak 
    
  • build build-arguments

    Performs an Nmake and runs PREfast on all compiled files and prints the PREfast results textually. Any build-arguments are passed as arguments to build. For example,

    prefast build /cefZ 
    

If an unrecognized command-line parameter is encountered, PREfast still performs the build by using the EXEC command.

The EXEC command is not normally invoked explicitly. It is implied any time an unknown build command is used.

For a list of switches available for use with the build command-line, see PREfast Build Command Switches.

For a list of additional commands you can use with PREfast, see PREfast Commands.

After PREfast is invoked, prefast.exe changes the environment settings and invokes the specified build command. The changes to the environment include prepending %PREFAST_ROOT%scripts\interceptcl; to PATH and BUILD_PATH.

The \interceptcl directory contains modified cl.exe and cl386.exe files that call the regular build compiler (cl.exe or cl386.exe from the rest of the path). The compiler performs PREfast analysis.

See Also

PREfast Warning Message Reference

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.