man gch (Commandes) - Ada Quality and Style Checker

NAME

gch - Ada Quality and Style Checker

SYNOPSIS

gch [gnat_options] file...

DESCRIPTION

gch (from Gnat CHecker) is a Ada rule-checking tool based on the ASIS implementation for GNAT. The tool checks Ada source code against a given set of rules. When a violation of some rule is detected, gch generates the corresponding GNAT-style diagnostic message.

From the users' viewpoint, gch can be used as a stand-alone rule-checking tool and as the GNAT compiler with a set of additional compile-time checks (depending on the options set, gch may create an object file for the source file being checked if no rule violation is detected).

The current version of gch checks a set of rules from the Ada 95 Quality and Style Guide document. This version is a kind of working prototype aimed at demonstrating the idea of ASIS-based rule checker for Ada programs.

gch operates on all the files given to it on the command line. It first creates an ASIS Context in which it parses any files necessary (by calling gnatgcc(1) in a special mode), and then uses the ASIS information generated by gnatgcc to check each source file against the rules. If the source code passes all the rules, gch then proceeds to produce object code for each file.

OPTIONS

-gnatc
Do not produce object files.

All other options are passed directly to gnatgcc(1). Note that, if you compile, you will most probably want to pass at least -c and -I. to gnatgcc. gnatgcc requires one of -c or -s, and cannot find the source code without -I..

The only way to pass options to gBgch is to write a file named gch.ini. gch looks for this file in the current directory and on the $PATH.

SYNTAX OF gch.ini

Lines that begin with one of the variable names listed below are interpreted as described with each variable. All other lines are ignored. There must be no white space before or after the variable name, otherwise the line is ignored. Also, the equals sign ('=') must not be separate from the variable name. Thus, you may write as much free text as you will in gch.ini, provided that you set each variable on a separate line. For each variable, the default value is provided after the '=' sign.

Verbose_Mode=True
Produce version information and, in case of processing more than one source file, name of each unit being checked.

Gnat_Mode=True
Produce diagnostics using the Gnat style file: line: column: violation Add a single line of violating source code, if Verbose_Mode is true.

Hide_Rejected_Files=True
Hide diagnostics about skipped files. gch skips files that do not conform to the GNAT naming convention.

Show_Global_Statistics=True
Show global statistics concerning all processed files.

Delete_Tree_Mode=True
Delete tree and .ali files after processing.

The following options pertain to the rule in the Quality and Style Guide, section 5.2.2: "Use named parameter association in calls of infrequently used subprograms or entries with many formal parameters".

Meaning_of_'infrequently used'=5
Number of times a subprogram must be called from within a single compilation unit to be considered "frequently called".

Meaning_of_'many formal parameters'=3

Processing of gch.ini stops when the following line is found:

End_Of_Gch.ini

AUTHOR

gch was written by Vitali Sh. Kaufman using a prototype and consultations by Sergey I. Rybin. This manual page was written for the Debian project by Ludovic Brenta <ludovic.brenta@insalien.org>.

SEE ALSO