Next: , Previous: Using gcc for Syntax Checking, Up: Compiler Switches


4.3.9 Using `gcc' for Semantic Checking

-gnatc
The c stands for 'check'. Causes the compiler to operate in semantic check mode, with full checking for all illegalities specified in the Ada Reference Manual, but without generation of any object code (no object file is generated).

Because dependent files must be accessed, you must follow the GNAT semantic restrictions on file structuring to operate in this mode:

The output consists of error messages as appropriate. No object file is generated. An ALI file is generated for use in the context of cross-reference tools, but this file is marked as not being suitable for binding (since no object file is generated). The checking corresponds exactly to the notion of legality in the Ada Reference Manual.

Any unit can be compiled in semantics-checking-only mode, including units that would not normally be compiled (subunits, and specifications where a separate body is present).