Fortran Programming Guide

Disabling All Signal Handlers

With f77, some system signal handlers for trapping interrupts, bus errors, segmentation violations, or illegal instructions are automatically enabled by default.

Although generally you would not want to turn off this default behavior, you can do so by compiling a C program that sets the global C variable f77_no_handlers to 1 and linking into your executable program:


demo% cat NoHandlers.c
      int  f77_no_handlers=1 ;
demo% cc -c NoHandlers.c
demo% f77 NoHandlers.o MyProgram.f

Otherwise, by default, f77_no_handlers is 0. The setting takes effect just before execution is transferred to the user program.

This variable is in the global name space of the program; do not use f77_no_handlers as the name of a variable anywhere else in the program.

With f90, no signal handlers are on by default.