Skip to main content

IAR Embedded Workbench for Arm 10.10.x

Getting started analyzing using C-STAT

このセクションの内容:
  1. Before you perform a static analysis, make sure your project builds without errors. For information about how to build a project, see プロジェクトのビルド.

  2. Choose Project>Options and select the Static Analysis>Select Checks category.

  3. On the C-STAT Checks page, select the packages of checks you want to use. For example C-STAT specific checks.

    SelectPackagesOfCstatChecks_Qt_03.png
  4. For each package, select groups of checks or individual checks:

    SelectCStatChecks_Qt_02.png

    For information about a specific check, see the reference documentation.

    When you have made your settings, click OK.

  5. To perform an analysis, make sure the project is active and execute one of these steps:

    • To analyze your project, select the project in the Workspace window and choose Project>C-STAT Static Analysis>Analyze Project.

    • To analyze one or more individual files, select the file(s) in the Workspace window and choose Project>C-STAT Static Analysis>Analyze File(s).

    Alternatively, use the corresponding commands on the context menu in the Workspace window instead.

  6. The result of the performed analysis is listed in the C-STAT Messages window.

    CStatAnalyzeResults_Qt_02.png

    For information about a specific check, see the reference documentation.

    For reference information, see C-STAT Messages window.

    注記

    If there are any problems when analyzing, the Build Log window displays detailed information.

  7. Double-click a C-STAT message to view the corresponding source code in the editor window:

    CStatMessageSource_1.png

    Point at a message with the mouse pointer to get tooltip information about which check that caused the message.

  8. Correct the error and click the next message in the C-STAT Messages window. Continue until all messages have been processed.

    注記

    C-STAT has a predefined macro, __CSTAT__, that you can use to explicitly include or exclude specific parts of source code from the analysis, see __CSTAT__. There are also specific C-STAT pragma directives that suppress one or more checks for selected source lines, see Descriptions of compiler extensions for C-STAT.