Ctrl + C being intercepted

Ctrl + C being intercepted

I have a Visual Studio 2010 C dll that has a Intel Visual Fortran Composer XE 2011 static library that is linked to the C dll.  This dll is loaded from a third party tool that uses Ctrl + C to interupt its iterpreter to lauch its debugger.  However, the Ctrl + C is intercepted by the FORTRAN runtime and gives a forrtl: error (200): program aborting due to control-C event.  According to the documentation, a dll should not have the default fortran runtime signal handling.  Does anyone know if there are some compiler settings that can be set on the static library to prevent it from causing the runtime signal handling to intercept the control-C.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

An interesting subject.

The Fortran run-time library establishes a "Console Control Handler" that gets called by Windows on a ^C event, using the SetConsoleCtrlHandler API routine. This handler displays the message you describe and then does the equivalent of CALL EXIT.

The Fortran handler looks to see if the user has set up a signal handler for SIGINT, and if so, doesn't do its exit processing. But it doesn't check for another console control handler being established (and there doesn't seem to be a way to do so.) You could establish your own signal handler, but I think that would override what your third party software is doing. 

If the Fortran handler routine were "public" you could deregister it, but it isn't. All I can think of for now is to submit a feature request to define yet another environment variable that disables registering this handler.

Steve - Intel Developer Support

For the next major release, in the second half of 2015, we have added support for defining an environment variable that disables the registering of the Fortran library's console control event handler. This won't help you right now, but will eventually.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today