| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
gcc. They will be passed on to all compiler invocations made by
gnatcheck to generate the ASIS trees. Here you can provide
`-I' switches to form the source search path,
and use the `-gnatec' switch to set the configuration file,
use the `-gnat05' switch if sources should be compiled in
Ada 2005 mode etc.
gnatcheck (see section 4. gnatcheck Rule Options).
Either a `filename' or an `arg_list_filename' must be supplied.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |