Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kbauer/4d8bb9348b422db8622b9ba7a4ac49e5 to your computer and use it in GitHub Desktop.
Save kbauer/4d8bb9348b422db8622b9ba7a4ac49e5 to your computer and use it in GitHub Desktop.
! writerec.f90
program main
implicit none
print '(*(1x,G0))', 'x', getX(), 'x', getX()
contains
integer function getX()
getX = 1
print *, '(inside getX)'
end function getX
end program main
! >> gfortran writerec.f90 -o a.bin
! >> ./a.bin
! x (inside getX)
! 1 x (inside getX)
! 1
! >> ifort -g -traceback writerec.f90 -o a.bin
! >> ./a.bin
! (inside getX)
! forrtl: severe (174): SIGSEGV, segmentation fault occurred
! Image PC Routine Line Source
! a.bin 0000000000403983 Unknown Unknown Unknown
! libpthread-2.26.s 00007FD220D6C300 Unknown Unknown Unknown
! libpthread-2.26.s 00007FD220D6D960 Unknown Unknown Unknown
! a.bin 0000000000407FF1 Unknown Unknown Unknown
! a.bin 0000000000435DF7 Unknown Unknown Unknown
! a.bin 000000000045ABEC Unknown Unknown Unknown
! a.bin 0000000000429614 Unknown Unknown Unknown
! a.bin 000000000040C163 Unknown Unknown Unknown
! a.bin 0000000000402A29 MAIN__ 4 writerec.f90
! a.bin 0000000000402952 Unknown Unknown Unknown
! libc-2.26.so 00007FD2207BCF8A __libc_start_main Unknown Unknown
! a.bin 000000000040286A Unknown Unknown Unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment