Last active
February 19, 2016 10:44
-
-
Save madgen/38b166731662eefcc1e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
c Bug 1: | |
c Mistakenly initialising unspecified common variable. | |
program nblock | |
integer x, y | |
common /name/x, y | |
call hello | |
call mello | |
print *, x, y | |
end | |
subroutine hello | |
common /name/x, y | |
integer x, y | |
c data statement treats y as initialised as well | |
c so when it is initialised in the other subroutine | |
c the value remains 0. | |
data x/2/ | |
return | |
end | |
subroutine mello | |
common /name/x, y | |
integer x, y | |
data y/15/ | |
return | |
end | |
c Bug 2: | |
c Missing error message. | |
program nblock | |
integer x, y | |
common /name/x, y | |
print *, x, y | |
end | |
block data hello | |
common /name/x, y | |
integer x, y | |
data x/2/ | |
end | |
c Here the common block with /name/ should throw an error | |
c as it has been used in a different block data subprogram | |
c the specification prohibits this use case. | |
block data mello | |
common /name/x, y | |
integer x, y | |
data y/15/ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment