Version 1.16r11 of June 5th, 2014
AdaControl is a free (GMGPL) tool that detects the use of various kinds of constructs in Ada programs. Its first goal is to control proper usage of style or programming rules, but it can also be used as a powerful tool to search for use (or non-use) of various forms of programming styles or design patterns. Searched elements range from very simple, like the occurrence of certaine entities, declarations, or statements, to very sophisticated, like verifying that certain programming patterns are being obeyed..
Which elements or constructs are searched is defined by a set of rules; the following table gives a short summary of rules currently checked by AdaControl. The number in parentheses after the rule name gives the number of subrules, if any. Considering all possible rules and subrules, this makes 513 tests that can be performed currently by AdaControl!
|Abnormal_Function_Return||Controls a design pattern that ensures that a function always returns a result .|
|Allocators||Controls ocurrences of allocators, either all of them, or those targeting specified types.|
|Array_Declarations (x6)||Controls several metrics in array declarations and types
used as indices
|Aspects||Controls aspect specifications (Ada 2012)
|Assignments (x3)||Controls issues related to assignments, like array sliding, multiple assignments to a same variable, or assignments to components of a structured variable that could be replaced by aggregate assignment..|
|Barrier_Expressions||Controls elements allowed in the expression of protected entries barriers|
|Case_Statement (x5)||Controls several metrics in case statements.|
|Characters (x4)||Controls occurrences of control characters (like tabs) in the source.|
|Comments (x4)||Controls the content or placement of certain comments.|
|Declarations (x159)||Controls occurrences of certain Ada declarations.|
|Default_Parameter||Controls subprogram calls and generic instantiations that use (or not) the default value for a given parameter.|
|Dependencies (x7)||Controls dependencies of units, either according to a set of allowed units, or by count.|
|Directly_Accessed_Globals||Controls a design pattern that ensures that all global variables are accessed only through dedicated subprograms.|
|Duplicate_Initialization_Calls||Controls design patterns that prevent double initialization of packages or variables.|
|Entities||Controls occurrences of any Ada entity.|
|Entity_Inside_Exception||Controls occurrences of entities inside exception handlers.|
|Exception_Propagation (x5)||Controls that certain subprograms (or tasks) cannot propagate exceptions, that no elaboration can propagate exceptions, or that an exception cannot propagate outside its scope of declaration.|
|Expressions (x53)||Controls usage of certain forms of expressions|
where the same element corresponds to several formal
||Controls unsynchronized accesses to global variables.|
|Header_Comments (x2)||Controls the presence of comments at the start of each module.|
|Improper_Initialization (x3)||Controls a design pattern that ensures that any variable is initialized before being used, and is not uselesly initialized.|
|Instantiations||Controls generic instantiations, either all of them, or those that use specified entities.|
|Insufficient_Parameters||Controls the use of positional parameters in calls where the value dœs not provide sufficient information.|
||Controls the use of access
values that designate non global entities.
|Local_Hiding (x2)||Controls occurrences of local identifiers that hide an identical outer one.|
|Max_Blank_Lines||Controls the occurrence of more than a specified number of consecutive empty lines.|
|Max_Call_Depth||Controls the maximum depth of subprogram calls.|
|Max_Line_Length||Controls maximal length of source lines.|
||Controls scopes nested more deeply than a given limit.|
|Max_Size (x20)||Controls maximum length of composite statements and compilation units.|
|Max_Statement_Nesting (x5)||Controls composite statements nested more deeply than a given limit.|
|Movable_Accept_Statements||Controls statements that could be moved outside an accept statement.|
|Naming_Convention||Controls the form of allowed (or forbidden) names in declarations.|
|No_Operator_Usage||Controls integer types where no operator, or only logical operators, are used.|
|Non_Static (x6)||Controls non static expressions in index or discriminant constraints, or in instantiations.|
|Not_Elaboration_Calls||Controls subprogram calls performed from places outside package elaboration code.|
|Not_Selected_Name||Controls that certain entities are always named using selected notation.|
|Object_Declarations (x4)||Controls various parameters of object declarations (constants and variables).|
|Parameter_Aliasing||Controls subprograms and entry calls where a variable is provided to more than one [in] out parameter.|
|Parameter_Declarations (x9)||Controls characteristics of parameters in callable entities (procedures, functions and entries)|
||Controls positional associations (as opposed to named associations).|
|Potentially_Blocking_Operations||Controls the use of potentially blocking operations from within protected operations.|
|Pragmas||Controls the use of specific pragmas.|
|Record_Declarations||Controls various aspects of the components of a record type.|
|Reduceable_Scope (x9)||Controls declarations that could be move to more deeply nested scopes.|
|Representation_Clauses (x11)||Controls occurrences of representation clauses.|
|Return_Type (x8)||Controls the use of certain kinds of types as return types of functions.|
|Side_Effect_Parameters||Controls subprogram calls and generic instantiations that call functions with side effect, thus creating a dependance to the order of evaluation.|
|Silent_Exceptions||Controls exception handlers that do not reraise exceptions nor call indicated subprograms.|
|Simplifiable_Expressions (x7)||Controls occurrences of various forms of expressions that could be simplified.|
|Simplifiable_Statements (x10)||Controls occurrences of various forms of statements that could be simplified.|
|Statements (x68)||Controls occurrences of Ada statements.|
|Style (x14)||Controls various forms of constructs generally recommended in style rules.|
|Terminating_Tasks||Controls a design pattern that ensures that tasks never terminate.|
|Type_Initial_Values||Controls that every declared type features an associated initialization constant.|
||Controls use of types or type categories at various places.|
|Uncheckable (x3)||Controls constructs that are not statically checkable by other rules|
||Controls usage patterns of program units and elements declared in them.|
|Units (x2)||Controls that all required units are analyzed, and only those.|
|Unnecessary_Use_Clause (x5)||Controls use clauses on packages, where no element of the package is referred to within the scope of the use clause.|
|Unsafe_Elaboration||Controsl packages that may be subject to incorrect elaboration order dependencies.|
|Unsafe_Paired_Calls||Controls a design pattern that ensures that certain calls are allways paired (like P/V procedures).|
|Unsafe_Unchecked_Conversion||Controls instantiations of Unchecked_Conversion between types of different or unspecified sizes.|
|Usage (x11)||Controls usage of objects under certain conditions (in package specifications, read, written modified...).|
|Use_Clauses (x6)||Controls occurrences of use clauses, except for indicated packages.|
|With_Clauses (x3)||Controls proper usage of with clauses.|
For more details on these rules, or on the use of AdaControl in general, please refer to the user's guide.
AdaControl is a command line tool, but it has been fully integrated into AdaCore's GPS environment. From GPS, you can run AdaControl, fix the violations, or edit the rules file with just a few clicks.
But AdaControl is more than a set of coding rules: it is a complete environment, designed to be easily extended. If your favorite rule is not provided, you can add it yourself! And of course, we will continue to extend the number of rules in the future. If you want to look into how this is possible, please refer to the AdaControl programmer guide.
Initial development of AdaControl was sponsored by Eurocontrol. Some rules were sponsored by BelgoControl, Ansaldo-STS (prev. CSEE-Transport) and SAGEM-DS. It is a mature tool, routinely used to check Ada codes at Eurocontrol (Brussels, more than 1_100_000 SLOC, Maastricht), BelgoControl, Ansaldo-STS, Faiveley, SAGEM-DS (level DO178B/A)... It has also been run against all executable tests from the ACATS.
AdaControl is an ASIS application.
AdaControl is a free tool under GMGPL license. Nonetheless, it is a commercial product from Adalog, for which we offer a maintenance contract. We offer also services for the development of rules for your specific needs, or more generally assistance for the definition and usage of programming rules. For information, please contact firstname.lastname@example.org.
AdaControl, like any ASIS application, can run only if compiled with the exact same version of the compiler that it uses itself when executing. It is therefore provided as executable only for GNAT GPL/2014 (Windows and Linux); for use with any other version of GNAT, please download the source version and recompile (which is quite easy to do, provided ASIS has been installed). It has been tested only with GNAT, but should be easily portable to any other compiler that provides an ASIS interface.
The ZIP or TGZ versions allow you to install AdaControl as you please; under Windows, the installers install everything automatically - provided the <GNAT>\bin directory is on your execution path.
Windows Gnat GPL 2014
Linux Gnat GPL 2014
incompatibility was introduced in the ASIS interface for Ada
2005/2012, which was necessary to properly handle some of the
new features. The source distribution of AdaControl requires at
least GnatPro-7.2.0 or GnatGPL 2013. If you want to use an
earlier version of Gnat, please dowload a source version from
(cf. below), using
branch "master-old_gnat" for versions up to GnatPro-7.0.x and
GnatGPL2011, and branch "GPL2012'' for GnatPro-7.1.x and
The current development version (unstable) is available (under GIT) from SourceForge. You can also find there intermediate versions between official releases that may be appropriate to certain versions of Gnat and even provide you own rating of AdaControl. You can submit bug reports, suggest improvements, etc. by clicking on "Ticket" on the SourceForge page or clicking on this direct link.
This article has been translated to Serbo-Croatian language by Jovana Milutinovich from Web Geeks Resources.