The following program fails on PGI 14.7 and 15.7. Intel fortran, NAG fortran and gfortran runs it just fine.
Is this fixed in 15.10? Is there a workaround - that does NOT involve interfacing to various C system calls? Is there a portable workaround at all?
~/testprog % cat foo.f90 program foo implicit none integer :: nbytes inquire (file='foo.f90', size=nbytes) write (*,*) 'File size of this file is:', nbytes end program foo ~/testprog % wc -c foo.f90; gfortran foo.f90 && ./a.out && pgfortran foo.f90 && ./a.out 164 foo.f90 File size of this file is: 164 File size of this file is: -1 ~/testprog % gfortran --version GNU Fortran (Ubuntu 4.8.5-1ubuntu1~14.04) 4.8.5 Copyright (C) 2015 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING ~/testprog % pgfortran -V pgfortran 15.7-0 32-bit target on x86-64 Linux -tp sandybridge The Portland Group - PGI Compilers and Tools Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.