Intel® Fortran Compiler 16.0 User and Reference Guide

GETEXCEPTIONPTRSQQ (W*S)

Run-Time Function: Returns a pointer to C run-time exception information pointers appropriate for use in signal handlers established with SIGNALQQ or direct calls to the C rtl signal( ) routine.

Module

USE IFCORE

result = GETEXCEPTIONPTRSQQ( )

Results

The result type is INTEGER(4) on IA-32 architecture; INTEGER(8) on Intel® 64 architecture. The return value is the address of a data structure whose members are pointers to exception information captured by the C runtime at the time of an exception. This result value can then be used as the eptr argument to routine TRACEBACKQQ to generate a stack trace from a user-defined handler or to inspect the exception context record directly.

Calling GETEXCEPTIONPTRSQQ is only valid within a user-defined handler that was established with SIGNALQQ or a direct call to the C rtl signal( ) function.

For a full description of exceptions and error handling, see Compiler Reference: Error Handling.

Example

   PROGRAM SIGTEST
   USE IFCORE
   ...
   R3 = 0.0E0
   STS = SIGNALQQ(MY_HANDLER)
   ! Cause a divide by zero exception
   R1 = 3.0E0/R3
   ...
   END
   INTEGER(4) FUNCTION MY_HANDLER(SIGNUM,EXCNUM)
   USE IFCORE
   ...
   EPTRS = GETEXCEPTIONPTRSQQ()
   ...
   CALL TRACEBACKQQ("Application SIGFPE error!",USER_EXIT_CODE=-1,EPTR=EPTRS)
   ...
   MY_HANDLER = 1
   END

See Also