In the following code, status should be returned as -1 with the following command line, but 0 is returned.
anon.exe 123456789
program anon
integer :: k, l
character(len=8) :: buffer
call get_command_argument(1, buffer, length=l, status=k)
print *, 'status = ', k,' Should be -1 but isn''t!'
print *, 'length = ', l,' Should be 9 and is!'
end program anon
The character array buffer contains the correct values (first 8 characters); it is just the status that is incorrect.
I can work around this by testing the length value, but probably this should be fixed. This may be a hang-over from the early days as this error also occurs in the F2KCLI code. Later compilers nagfor, ifort, gfortran don't have this issue.