[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Introduction

The gnatcheck tool is an ASIS-based utility that checks properties of Ada source files according to a given set of semantic rules.

In order to check compliance with a given rule, gnatcheck has to semantically analyze the Ada sources. Therefore, checks can only be performed on legal Ada units. Moreover, when a unit depends semantically upon units located outside the current directory, the source search path has to be provided when calling gnatcheck, either through a specified project file or through gnatcheck switches as described below.

If the set of sources to be processed by gnatcheck contains sources with preprocessing directives then the needed options should be provided to run preprocessor as a part of the gnatcheck call, and detected rule violations will correspond to preprocessed sources.

A number of rules are predefined in gnatcheck and are described later in this chapter. You can also add new rules, by modifying the gnatcheck code and rebuilding the tool. In order to add a simple rule making some local checks, a small amount of straightforward ASIS-based programming is usually needed.

Project support for gnatcheck is provided by the GNAT driver (see The GNAT Driver and Project Files section in GNAT User's Guide).

Invoking gnatcheck on the command line has the form:

 
$ gnatcheck [switches]  {filename}
      [-files={arg_list_filename}]
      [-cargs gcc_switches] -rules rule_options

where

Either a `filename' or an `arg_list_filename' must be supplied.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by GNAT Mailserver on May, 6 2015 using texi2html