Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GETEXCEPTIONPTRSQQ

Runtime Function: Returns a pointer to C runtime exception information pointers appropriate for use in signal handlers established with SIGNALQQ or direct calls to the C rtl signal( ) routine. This routine is only available for Windows.

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 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