I wrote following code which call buildin function signal. And I compiled this code by following command. But I failed compilation. Should I pass the any linker option to compiler ? Compiler version is 13.5. Please teach me.
program test implicit none real a,b,c integer ret, sigNum, flg external divByZeroHdler flg = -1 !! P;ease reference /usr/include/bits/signum.h sigNum = 8 a = 3 b = 0 WRITE(*,*) 'Hello' ret = signal(sigNum, divByZeroHdler, flg) c = a/b; WRITE(*,*) 'Good bye' end program test subroutine divByZeroHdler() WRITE(*,*) 'divByZeroHdler is called' end subroutine divByZeroHdler
$ pgfortran --version pgfortran 13.5-0 64-bit target on x86-64 Linux -tp sandybridge Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved. Copyright 2000-2013, STMicroelectronics, Inc. All Rights Reserved. $ pgfortran test.F PGF90-S-0038-Symbol, signal, has not been explicitly declared (test.F) 0 inform, 0 warnings, 1 severes, 0 fatal for test