Commit c1bacb90 by Sergey Rybin Committed by Arnaud Charlet

gnat_ugn.texi: Changing the description of the gnatcheck metrics rule according to the change...

2008-08-05  Sergey Rybin  <rybin@adacore.com>

	* gnat_ugn.texi: Changing the description of the gnatcheck metrics
	rule according to the change in the rule option.
	Add documentation for -gnatw.b/-gnatw.B

From-SVN: r138716
parent e3834d38
...@@ -4832,6 +4832,21 @@ are not generated. ...@@ -4832,6 +4832,21 @@ are not generated.
This switch suppresses warnings for static fixed-point expressions whose This switch suppresses warnings for static fixed-point expressions whose
value is not an exact multiple of Small. value is not an exact multiple of Small.
@item -gnatw.b
@emph{Activate warnings on biased representation.}
@cindex @option{-gnatw.b} (@command{gcc})
@cindex Biased representation
This switch activates warnings when a size clause, value size clause, component
clause, or component size clause forces the use of biased representation for an
integer type (e.g. representing a range of 10..11 in a single bit by using 0/1
to represent 10/11). The default is that such warnings are generated.
@item -gnatw.B
@emph{Suppress warnings on biased representation.}
@cindex @option{-gnatwB} (@command{gcc})
This switch suppresses warnings for representation clauses that force the use
of biased representation.
@item -gnatwc @item -gnatwc
@emph{Activate warnings on conditionals.} @emph{Activate warnings on conditionals.}
@cindex @option{-gnatwc} (@command{gcc}) @cindex @option{-gnatwc} (@command{gcc})
...@@ -20510,7 +20525,7 @@ used as a parameter of the @option{+R} or @option{-R} options. ...@@ -20510,7 +20525,7 @@ used as a parameter of the @option{+R} or @option{-R} options.
@ignore @ignore
* Improperly_Called_Protected_Entries:: * Improperly_Called_Protected_Entries::
@end ignore @end ignore
* Metrics_Violation:: * Metrics::
* Misnamed_Identifiers:: * Misnamed_Identifiers::
* Multiple_Entries_In_Protected_Definitions:: * Multiple_Entries_In_Protected_Definitions::
* Name_Clashes:: * Name_Clashes::
...@@ -21011,64 +21026,25 @@ Flag each protected entry that can be called from more than one task. ...@@ -21011,64 +21026,25 @@ Flag each protected entry that can be called from more than one task.
This rule has no parameters. This rule has no parameters.
@end ignore @end ignore
@node Metrics_Violation @node Metrics
@subsection @code{Metrics_Violation} @subsection @code{Metrics}
@cindex @code{Metrics} rule (for @command{gnatcheck}) @cindex @code{Metrics} rule (for @command{gnatcheck})
@noindent @noindent
This is an umbrella rule for a set of metrics-based checks. The parameters of This is an umbrella rule for a set of metrics-based checks. Each metric-based
the rule specify which metrics should be checked, and a bound (upper or lower, check has its own rule name that starts from the common prefix
depending on the metric) for each specified metric. A construct is @code{Metrics_}. For @option{+R} option, this name ends with @code{_GT}
flagged if a specified metric can be computed for it, and the resulting value (greater then) or @code{_LT} (less then). The parameter of the rule
is higher then the upper bound (or less than the lower bound) specified. @option{+R} option specifies bound (upper or lower, depending on the metric)
for the given metric. A construct is flagged if a specified metric can be
computed for it, and the resulting value is higher then the upper bound (or
less than the lower bound) specified. Parameters and metric names are not
case-sensitive @option{-R} option does not have a parameter and it turns OFF
the check for the metric indicated by the metric rule name.
This rule has the following parameters: The following table shows the available metrics-based checks, including the
constraint that must be satisfied by the bound that is specified for the check
@itemize @bullet and what bound - upper (U) or lower (L) - should be specified.
@item
For the @option{+R} option:
@table @code
@item @i{Metric_Check_Name} < @i{LowerBound}
Turns the check for the specified metric ON and specifies the lower bound
for a given metric check
@item @i{Metric_Check_Name} > @i{UpperBound}
Turns the check for the specified metric ON and specifies the upper bound
for a given metric check
@end table
@item
For the @option{-R} option:
@table @code
@item @i{Metric_Check_Name}
Turns the check for the specified metric OFF
@end table
@end itemize
@noindent
Parameters are not case-sensitive. @i{Metric_Check_Name} must be
the name of a metric supported by the @code{Metrics_Violation} rule
(see the table below),
otherwise the parameter is ignored. Whether the upper or lower bound
is specified for a given check, depends on the metric. If a
parameter for the @option{+R} option specifies an invalid limit, a
warning is issued and the parameter is ignored.
The @option{-R} option without parameters turns OFF all the previously enabled
metric checks. the @option{+R} option without parameters turns ON all the
metric checks that have been defined by previous @option{+R} options with
valid parameters. @option{+R} option with a valid
parameter also turns ON all the other metric checks that have been defined
by previous @option{+R} options with valid parameters if they have been
disabled by @option{-R} option without parameters.
By default no metrics checks are ON, so the @option{+R} option without
parameters actually does not specify any check.
The following table shows the available metrics-based checks,
including the constraint that must be satisfied by the bound that
is specified for the check.
@multitable {@code{Cyclomatic_Complexity}}{Cyclomatic complexity}{Positive integer} @multitable {@code{Cyclomatic_Complexity}}{Cyclomatic complexity}{Positive integer}
@ifnothtml @ifnothtml
...@@ -21078,9 +21054,9 @@ is specified for the check. ...@@ -21078,9 +21054,9 @@ is specified for the check.
@item @b{Check Name} @tab @b{Description} @tab @b{Bounds Value} @item @b{Check Name} @tab @b{Description} @tab @b{Bounds Value}
@end ifhtml @end ifhtml
@c Above conditional code is workaround to bug in texi2html (Feb 2008) @c Above conditional code is workaround to bug in texi2html (Feb 2008)
@item @code{Essential_Complexity} @tab Essential complexity @tab Positive integer @item @code{Essential_Complexity} @tab Essential complexity @tab Positive integer (U)
@item @code{Cyclomatic_Complexity} @tab Cyclomatic complexity @tab Positive integer @item @code{Cyclomatic_Complexity} @tab Cyclomatic complexity @tab Positive integer (U)
@item @code{LSLOC} @tab Logical Source Lines of Code @tab Positive integer @item @code{LSLOC} @tab Logical Source Lines of Code @tab Positive integer (U)
@end multitable @end multitable
@noindent @noindent
...@@ -21089,11 +21065,16 @@ the same as for the corresponding metrics in @command{gnatmetric}. ...@@ -21089,11 +21065,16 @@ the same as for the corresponding metrics in @command{gnatmetric}.
@emph{Example:} the rule @emph{Example:} the rule
@smallexample @smallexample
+RMetrics_Violation: Cyclomatic_Complexity > 7 +RMetrics_Cyclomatic_Complexity_GT : 7
@end smallexample @end smallexample
@noindent @noindent
means that all bodies with cyclomatic complexity exceeding 7 will be flagged. means that all bodies with cyclomatic complexity exceeding 7 will be flagged.
To turn OFF the check for cyclomatic complexity metric, use the following option:
@smallexample
-RMetrics_Cyclomatic_Complexity
@end smallexample
@node Misnamed_Identifiers @node Misnamed_Identifiers
@subsection @code{Misnamed_Identifiers} @subsection @code{Misnamed_Identifiers}
@cindex @code{Misnamed_Identifiers} rule (for @command{gnatcheck}) @cindex @code{Misnamed_Identifiers} rule (for @command{gnatcheck})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment