@@ -4316,6 +4316,21 @@ the pragma ``Restrictions`` or ``Restriction_Warnings``.
43164316 Restrictions: {Arg: ["Max_Task_Entries=>2", "No_Access_Subprograms"]}
43174317 }
43184318
4319+ .. attention ::
4320+ It is forbidden to provide the same restriction name in multiple instances
4321+ of the ``Restrictions `` rule. Meaning that such configuration is invalid and
4322+ will cause GNATcheck to issue an error message:
4323+
4324+ .. code-block :: lkql
4325+
4326+ val rules = @{
4327+ Restrictions: [
4328+ {Arg: ["Max_Task_Entries=>2", "No_Access_Subprograms"]},
4329+ {Arg: ["Max_Task_Entries=>6"], instance_name: "Another_Instance"}
4330+ # ^^^^^^^^^^^^^^^^ The "Max_Task_Entries" name is provided in multiple instances of "Restrictions"
4331+ ]
4332+ }
4333+
43194334 If your code contains pragmas ``Warnings `` with parameter ``Off ``, this may
43204335result in false negatives for this rule, because the corresponding warnings
43214336generated during compilation will be suppressed. The workaround is to
@@ -5362,6 +5377,21 @@ mentioned above).
53625377 Warnings: "u"
53635378 }
53645379
5380+ .. attention ::
5381+ It is forbidden to provide the same parameter in multiple instance of the
5382+ ``Warnings `` rule. Meaning that such configuration is invalid and will cause
5383+ GNATcheck to issue an error message:
5384+
5385+ .. code-block :: lkql
5386+
5387+ val rules = @{
5388+ Warnings: [
5389+ {Arg: "u"},
5390+ {Arg: "u", instance_name: "Another_Instance"}
5391+ # ^-- The "u" parameter is provided in multiple instances of "Warnings"
5392+ ]
5393+ }
5394+
53655395 Note that ``s `` and ``e `` parameters, corresponding respectively to GNAT
53665396``-gnatws `` and ``-gnatwe `` options, are not allowed for the ``Warnings ``
53675397GNATcheck rule since they may have side effects on other rules.
@@ -6236,6 +6266,21 @@ the compiler style check that corresponds to ``-gnatyO`` style check option.
62366266 Style_Checks: "xz"
62376267 }
62386268
6269+ .. attention ::
6270+ It is forbidden to provide the same parameter in multiple instances of the
6271+ ``Style_Checks `` rule. Meaning that such configuration is invalid and will
6272+ cause GNATcheck to issue an error message:
6273+
6274+ .. code-block :: lkql
6275+
6276+ val rules = @{
6277+ Style_Checks: [
6278+ {Arg: "xz"},
6279+ {Arg: "x", instance_name: "Another_Instance"}
6280+ # ^-- The "x" parameter is provided in multiple instances of "Style_Checks"
6281+ ]
6282+ }
6283+
62396284 This rule allows parametric rule exemptions, the parameters
62406285that are allowed in the definition of exemption sections are the
62416286same as the parameters of the rule itself.
0 commit comments