public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Failed assertion dialog box
@ 2020-11-13 17:27 William M. (Mike) Miller
  2020-11-14  3:45 ` Duncan Roe
  0 siblings, 1 reply; 21+ messages in thread
From: William M. (Mike) Miller @ 2020-11-13 17:27 UTC (permalink / raw)
  To: The Cygwin Mailing List

I've run into a problem running a collection of tests under Cygwin and I
wonder if anyone can suggest a way around it.

The problem occurs when a program being run fails a C/C++ runtime
assertion. Ordinarily, this just writes an error message on stderr and
aborts. Under Cygwin, however, if both stdin and stderr are redirected to
files, the program instead pops up a dialog box that must be interactively
dismissed before the failed program will exit - holding up all the tests
that follow it.

Specifically, if I have the following as assert.cpp:

    #include <assert.h>
    int main() {
      assert(false);
    }

and say

    gcc assert.cpp
    ./a.exe < /dev/null > output 2>&1

I get an error dialog box saying

    Failed assertion
        false
    at line 3 of file assert.cpp
    in function int main()

If I omit either the stdin or the stderr redirection, the program behaves
as desired with no dialog box.

Is there an environment setting or compiler command-line option I can give
to suppress the dialog box and always just write a message to stderr and
abort? Thanks for any insights.

-- 
William M. (Mike) Miller | Edison Design Group
william.m.miller@gmail.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-11-20  7:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 17:27 Failed assertion dialog box William M. (Mike) Miller
2020-11-14  3:45 ` Duncan Roe
2020-11-14  4:21   ` William M. (Mike) Miller
2020-11-14  4:37     ` André Bleau
2020-11-14  5:37       ` Lemures Lemniscati
2020-11-14 14:12         ` William M. (Mike) Miller
2020-11-14 15:24           ` Lemures Lemniscati
2020-11-14 15:53             ` William M. (Mike) Miller
2020-11-15  4:46     ` Duncan Roe
2020-11-15 13:12       ` William M. (Mike) Miller
2020-11-15 20:04         ` André Bleau
2020-11-15 20:39           ` André Bleau
2020-11-15 20:59             ` William M. (Mike) Miller
2020-11-19 14:21             ` Failed assertion dialog box ATTN: Takashi Yano André Bleau
2020-11-19 18:30               ` Thomas Wolff
2020-11-19 21:53                 ` André Bleau
2020-11-20  0:06                 ` Duncan Roe
2020-11-20  0:19                   ` Takashi Yano
2020-11-20  1:40                     ` Duncan Roe
2020-11-20  2:04                     ` Duncan Roe
2020-11-20  7:09                       ` Thomas Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).