-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/gnatkp_exemptions' into 'master'
Split GNATkp exemptions from others Closes #336 See merge request eng/libadalang/langkit-query-language!307
- Loading branch information
Showing
7 changed files
with
105 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
project Prj is | ||
for Source_Dirs use ("src"); | ||
end Prj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
procedure Main is | ||
type Int_Arr is array (1 .. 3) of Integer; | ||
|
||
X : Int_Arr; | ||
|
||
A_1 : Int_Arr := (1, 2, 3) -- FLAG | ||
with Address => X'Address; | ||
|
||
pragma Annotate (GnatKP, Exempt_On, "kp_19198", "Because"); | ||
A_2 : Int_Arr := (1, 2, 3) -- FLAG | ||
with Address => X'Address; | ||
pragma Annotate (GnatKP, Exempt_Off, "kp_19198"); | ||
|
||
--## kp off kp_19198 ## Because | ||
A_3 : Int_Arr := (1, 2, 3) -- FLAG | ||
with Address => X'Address; | ||
--## kp on kp_19198 | ||
begin | ||
goto lbl; -- FLAG | ||
|
||
pragma Annotate (Gnatcheck, Exempt_On, "goto_statements", "Because"); | ||
goto lbl; -- FLAG | ||
pragma Annotate (Gnatcheck, Exempt_Off, "goto_statements"); | ||
|
||
--## rule off goto_statements ## Because | ||
goto lbl; -- FLAG | ||
--## rule on goto_statements | ||
|
||
<<lbl>> | ||
end Main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
GNATcheck mode | ||
============== | ||
|
||
main.adb:22:04: goto statement | ||
(Because) | ||
main.adb:26:04: goto statement | ||
(Because) | ||
main.adb:19:04: goto statement | ||
no rule exemption problems detected | ||
no language violations detected | ||
no internal error detected | ||
|
||
GNATKP mode | ||
=========== | ||
|
||
main.adb:10:04: possible occurrence of KP 19198 | ||
(Because) | ||
main.adb:15:04: possible occurrence of KP 19198 | ||
(Because) | ||
main.adb:6:04: possible occurrence of KP 19198 | ||
no rule exemption problems detected | ||
no language violations detected | ||
no internal error detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
driver: gnatcheck | ||
project: prj.gpr | ||
format: short | ||
tests: | ||
- label: GNATcheck mode | ||
mode: gnatcheck | ||
rules: | ||
- +Rgoto_statements | ||
- label: GNATKP mode | ||
mode: gnatkp | ||
rules: | ||
- +Rkp_19198 |