-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And streamline the check description for better readability.
- Loading branch information
Showing
3 changed files
with
91 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
! PWR007: Disable implicit declaration of variables | ||
|
||
subroutine example() | ||
program example | ||
! NOT-PWR071: We`re using implicit typing on purpose | ||
num1 = 7 | ||
num2 = 2.5 ! num2 is implicitly typed as integer | ||
res = num1 / num2 ! res = 3.0 | ||
end subroutine example | ||
res = num1 / num2 | ||
print *, res | ||
end program example |
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,13 @@ | ||
! PWR007: Disable implicit declaration of variables | ||
|
||
program solution | ||
use iso_fortran_env, only: real32 | ||
implicit none | ||
integer :: num1 | ||
real(kind=real32) :: num2, res | ||
|
||
num1 = 7 | ||
num2 = 2.5 | ||
res = num1 / num2 | ||
print *, res | ||
end program solution |