Skip to content

Commit a00bfe0

Browse files
committed
Merge branch 'topic/kp_19447' into 'master'
Implement KP detector for 19447 Closes #309 See merge request eng/libadalang/langkit-query-language!270
2 parents 73fee0e + eaa8c77 commit a00bfe0

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@check(help="possible occurrence of KP 19447",
2+
message="possible occurrence of KP 19447",
3+
impact="24.*")
4+
fun kp_19447(node) =
5+
|" To be safe, this KP detector flags all references to the Finalization_Size
6+
|" attribute.
7+
node is AttributeRef
8+
when node.f_attribute.p_name_is("Finalization_Size")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
procedure Main is
2+
I : Integer := 0;
3+
begin
4+
if I'Finalization_Size > 0 then null; end if; -- FLAG
5+
end Main;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Prj is
2+
end Prj;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
main.adb:4:7: rule violation: possible occurrence of KP 19447
2+
4 | if I'Finalization_Size > 0 then null; end if; -- FLAG
3+
| ^^^^^^^^^^^^^^^^^^^
4+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
driver: checker
2+
rule_name: KP_19447
3+
project: prj.gpr

testsuite/tests/gnatcheck/xml_help/test.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ testsuite_driver: No output file generated by gnatcheck
156156
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
157157
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
158158
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
159+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
159160
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
160161
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
161162
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -303,6 +304,7 @@ testsuite_driver: No output file generated by gnatcheck
303304
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
304305
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
305306
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
307+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
306308
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
307309
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
308310
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -462,6 +464,7 @@ testsuite_driver: No output file generated by gnatcheck
462464
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
463465
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
464466
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
467+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
465468
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
466469
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
467470
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -643,6 +646,7 @@ testsuite_driver: No output file generated by gnatcheck
643646
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
644647
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
645648
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
649+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
646650
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
647651
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
648652
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -833,6 +837,7 @@ testsuite_driver: No output file generated by gnatcheck
833837
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
834838
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
835839
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
840+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
836841
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
837842
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
838843
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -1068,6 +1073,7 @@ testsuite_driver: No output file generated by gnatcheck
10681073
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
10691074
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
10701075
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
1076+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
10711077
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
10721078
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
10731079
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -1423,6 +1429,7 @@ testsuite_driver: No output file generated by gnatcheck
14231429
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
14241430
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
14251431
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
1432+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
14261433
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
14271434
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
14281435
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>
@@ -1789,6 +1796,7 @@ testsuite_driver: No output file generated by gnatcheck
17891796
<check switch="+Rkp_19237" label="possible occurrence of KP 19237"/>
17901797
<check switch="+Rkp_19312" label="possible occurrence of KP 19312"/>
17911798
<check switch="+Rkp_19341" label="possible occurrence of KP 19341"/>
1799+
<check switch="+Rkp_19447" label="possible occurrence of KP 19447"/>
17921800
<check switch="+Rkp_ob03_009" label="possible occurrence of KP OB03-009"/>
17931801
<check switch="+Rkp_p226_024" label="possible occurrence of KP P226-024 - global analysis required"/>
17941802
<check switch="+Rkp_q309_014" label="possible occurrence of KP Q309-014"/>

0 commit comments

Comments
 (0)