delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/06/03:51:14

X-Spam-Check-By: sourceware.org
Message-ID: <43E70DF0.A05E2BBB@dessent.net>
Date: Mon, 06 Feb 2006 00:50:56 -0800
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: how to avoid error dialog during app crash when non-interactive
References: <ds6uem$r5l$1 AT sea DOT gmane DOT org>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hans Horn wrote:

> I have an app build with gcc -mno-cygwin, that constantly bombards me with
> error dialogs as shown in the attachment.
> The app is meant to run non-interactively.
> Is there a way to compile the app differently so error notifications get
> simply printed out rather than being presented via dialog?

First of all, you're using the mingw compiler when you use -mno-cygwin,
so you should ask on the mingw list.  This has little to do with Cygwin.

But I don't think there's a lot you can do about this other than
obviously fixing your bugs that are causing the faults.  When you use
mingw you are using the Microsoft C runtime library (MSVCRT) and it sets
up its the fault hander which is what is showing the above dialog.  So I
don't think you have any control in that aspect.

I suppose you could try installing your own handler in the SEH chain
that would catch the access violation and handle it in some way.  If you
were using MSVC you could just use _try/_except but unfortunately gcc
does not support this, so you would have to do it manually.  (Is there a
set of macros out there somewhere that eases this?)  You'll have to
consult MSDN or google for more details there, not exactly on topic for
this list since Cygwin does exception handling in the posix way.  A
starting point is
<http://www.microsoft.com/msj/0197/Exception/Exception.aspx>.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019