@@ -520,7 +520,7 @@ justified violations. However, exempted violations along with their
520
520
justification are documented in a special section of the report file that
521
521
``gnatcheck `` generates.
522
522
523
- .. _ Using_pragma_``Annotate``_to_Control_Rule_Exemption :
523
+ .. _ Using_pragma_Annotate_to_Control_Rule_Exemption :
524
524
525
525
Using pragma ``Annotate `` to Control Rule Exemption
526
526
---------------------------------------------------
@@ -701,49 +701,41 @@ Using GNATcheck as a Known Problem Detector
701
701
702
702
If you are a GNAT Pro Assurance customer, you have access to a special
703
703
packaging of GNATcheck called ``gnatkp `` (GNAT Known Problem detector)
704
- where the ``gnatcheck `` executable is replaced by ``gnatkp `` and provides
705
- the following main user interface:
704
+ where the ``gnatcheck `` executable is replaced by ``gnatkp ``, and the
705
+ coding standard rules are replaced by rules designed to detect constructs
706
+ affected by known problems in official compiler releases. Note that GNATkp
707
+ comes in addition and not as a replacement of GNATcheck.
706
708
707
- .. code-block :: sh
709
+ You can use the command ``gnatkp --help `` to list all the switches
710
+ relevant to GNATkp. GNATkp mostly accepts the same command arguments as
711
+ GNATcheck and behaves in a similar way, but there are some differences that
712
+ are described below.
708
713
709
- gnatkp -Pproject -rules +Rkp_xxxx_xxx [+Rkp_xxxx_xxx]
710
-
711
- where ``kp_xxxx_xxx `` is the name of a relevant known-problem to detect. You can
712
- get the list of detectors available via the command ``gnatkp -h ``. When
713
- combined with the ``--kp-version `` and possibly ``--target `` switches (see
714
- below), ``gnatkp -h `` will only list the detectors relevant to the version
715
- (and target) specified.
716
-
717
- Note that GNATkp comes in addition and not as a replacement of GNATcheck: it
718
- only comes with known problem detectors, and does not include coding standard
719
- rules.
720
-
721
- The ``gnatkp `` command above will process all the files in the
722
- given project file and run the listed known problem detectors, generating
723
- a list of occurrences on standard error, as well as in a file called
724
- :file: `gnatkp.out `.
725
-
726
- Alternatively you can specify the version of GNAT Pro relevant to your
727
- query and let ``gnatkp `` run all the registered known problem detectors
728
- relevant to this version, via the ``--kp-version `` switch, e.g:
714
+ The easiest way to use GNATkp is by specifying the version of GNAT Pro that
715
+ you have and letting ``gnatkp `` run all known problem detectors
716
+ registered for this version, via the switch ``--kp-version ``. For example:
729
717
730
- .. code-block :: sh
718
+ .. code-block :: none
731
719
732
720
gnatkp -Pproject --kp-version=21.2
733
721
734
- will run all the detectors relevant to GNAT Pro 21.2. The list of detectors
735
- will be displayed as info messages, and will also be listed in the file
736
- :file: `gnatkp-rule-list.out `. You can also list them without running the
737
- detectors via:
722
+ will run all detectors relevant to GNAT Pro 21.2 on all files in the
723
+ project. The list of detectors will be displayed as info messages, and will
724
+ also be listed in the file :file: `gnatkp-rule-list.out `. The list of detected
725
+ source locations will be generated on standard error, as well as in a file
726
+ called :file: `gnatkp.out `.
738
727
739
- .. code-block :: sh
728
+ You can display the list of detectors without running them by specifying
729
+ additionally the ``-h `` switch, e.g.:
730
+
731
+ .. code-block :: none
740
732
741
733
gnatkp --kp-version=21.2 -h
742
734
743
735
You can also combine the ``--kp-version `` switch with the ``--target `` switch
744
736
to filter out detectors not relevant for your target, e.g:
745
737
746
- .. code-block :: sh
738
+ .. code-block :: none
747
739
748
740
gnatkp -Pproject --kp-version=21.2 --target=powerpc-elf
749
741
@@ -753,14 +745,25 @@ target.
753
745
Note that you need to have the corresponding target GNAT compiler installed
754
746
to use this option. By default, detectors for all targets are enabled.
755
747
756
- You can also use the command ``gnatkp --help `` to list all the switches
757
- relevant to ``gnatkp ``.
748
+ It is also possible to specify the custom list of detectors for GNATkp to run
749
+ using the switch ``-rules ``:
750
+
751
+ .. code-block :: none
752
+
753
+ gnatkp -Pproject -rules +Rkp_xxxx_xxx [+Rkp_xxxx_xxx]
754
+
755
+ where ``kp_xxxx_xxx `` is the name of a relevant known-problem to detect. You
756
+ can get the list of available detectors via the command ``gnatkp -h ``. When
757
+ combined with the ``--kp-version `` and possibly ``--target `` switches,
758
+ ``gnatkp -h `` will only list the detectors relevant to the version
759
+ (and target) specified.
758
760
759
761
You can check via the GNAT Tracker interface which known problems are
760
762
relevant to your version of GNAT and your target before deciding which
761
763
known problems may impact you: most known problems are only relevant to a
762
- specific version of GNAT or a specific target. Do not hesitate to contact the
763
- AdaCore support if needed to identify the relevant entries.
764
+ specific version of GNAT, a specific target, or a specific usage profile. Do
765
+ not hesitate to contact the AdaCore support if you need help identifying the
766
+ entries that may be relevant to you.
764
767
765
768
.. _Transition_from_ASIS-based_GNATcheck :
766
769
0 commit comments