---
name: "gnatcheck"
section: "1"
platform: "linux"
package: "asis-programs"
version: "2019-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/gnatcheck"
---

# gnatcheck(1)

GNAT rule checking tool

## NAME

gnatcheck - GNAT rule checking tool

## SYNOPSIS

**gnatcheck** \[*OPTION*\]... *filename* \[**-cargs** *gcc\_switches*\] \[**-rules** *rule\_switches*\]

**gnatcheck** \[*OPTION*\]... -files=*filename* \[**-cargs** *gcc\_switches*\] \[**-rules** *rule\_switches*\]

## DESCRIPTION

**gnatcheck** checks the conformance of Ada source text with rules and produces a report file for later analysis as well as on standard output.

In the first form, **gnatcheck** examines the specified Ada source files (wildcards are allowed).

In the second form, **gnatcheck** examines the Ada source files listed in the specified file.

**gnatcheck** is an ASIS application developed on top of the ASIS implementation for GNAT.  As such, it reads tree files (*\*.adt*) produced by the compiler to accomplish its goals, and invokes **gnatgcc** for this.

## OPTIONS

- **-a**

  Process RTL units.

- **-cargs** *gcc\_switches*

  Pass *gcc\_switches* to GCC when producing the tree files.

- **-d**

  Debug mode.

- **-dd**

  Progress indicator mode, for use in the GNAT Programming Studio.

- **-h**

  Print the list of built-in rules.

- **-l**

  Full source location chains in report file.

- **-q**

  Quiet mode: do not report detections on standard output.

- **-rules** *rule\_switches*

  *rule\_switches* can be any combination of the following:

  - **-from**=*file*

    Read rule options from *file*

  - **+ALL**

    Turn all rules on.

  - **-ALL**

    Turn all rules off.

  - **+R***rule\_id*\[:*param*\[,*param*...\]\]

    Turn the specified rule on, passing it optional parameters.

  - **-R***rule\_id*

    Turn the specified rule off.

  - **+R***rule\_id*\[:*param*\[,*param*...\]\]

    Turn off some of the checks for the specified rule.

  *rule\_id* is any of the rules listed with the **-h** option.

- **-s**

  Short form of the report file.

- **-s***n*

  Include only section *n* (*n* in 1 .. 3) in the report file.

- **-v**

  Verbose mode.

## SEE ALSO

[gnat(1)](/gnat/1.md), [asistant(1)](/asistant/1.md), [gnat2xml(1)](/gnat2xml/1.md), [gnatelim(1)](/gnatelim/1.md), [gnatmetric(1)](/gnatmetric/1.md), [gnatpp(1)](/gnatpp/1.md), [gnatstub(1)](/gnatstub/1.md), [gnattest(1)](/gnattest/1.md)

Documentation about the ASIS tools may be found in */usr/share/doc/asis-doc/* if the **asis-doc** package is installed. The reference documentation about ASIS is excluded due to license problems, but may be found in various formats at *http://libre.adacore.com/developers/documentation*.
