bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: abort on mingw


From: Bruno Haible
Subject: Re: abort on mingw
Date: Sat, 1 Jan 2011 19:02:28 +0100
User-agent: KMail/1.9.9

Hi Ben,

> > On mingw,
> > stdio buffers are not flushed when abort() is called, i.e. their contents
> > gets lost.
> 
> Does this mean that mingw also fully buffers stderr?  This is a
> violation of the C standard, which says, "As initially opened,
> the standard error stream is not fully buffered; [...]".

I don't know how in detail stderr is constructed on mingw. All I know is that
stderr output before abort() is lost if there is no fflush:

$ cat foo.c
#include <stdio.h>
#include <stdlib.h>
int main ()
{
  fprintf (stderr, "foobar\n");
  abort ();
}

$ gcc -mno-cygwin foo.c

$ ./a.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

$ cat foo.c
#include <stdio.h>
#include <stdlib.h>
int main ()
{
  fprintf (stderr, "foobar\n");
  fflush (stderr);
  abort ();
}

$ gcc -mno-cygwin foo.c

$ ./a.exe
foobar

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Seen with mingw as part of Cygwin 1.5.x.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]