[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Poor Win32 C runtime implementation
From: |
Michael Goffioul |
Subject: |
Poor Win32 C runtime implementation |
Date: |
Tue, 16 Feb 2010 09:20:55 +0000 |
Hi,
I've been caught by a poor Win32 C runtime implementation that is unfortunately
triggered by some gnulib replacement functions. This affects the VC2008
runtime DLL, I didn't test if this also affect the runtime DLL used by MinGW.
For instance, these 2 simple pieces of code produce a crash. I can
work around these in my local copy of gnulib. I just wanted to report them.
1) "signal" with unsupported signal
#include <signal.h>
void handler(int sig) { }
int main()
{
signal(0, handler);
return 0;
}
2) "fclose" with an invalid file descriptor
#include <stdio.h>
#include <io.h>
int main()
{
FILE *fp = fopen("configure", "r");
close(fileno(fp));
fclose(fp);
return 0;
}
Michael.
- Poor Win32 C runtime implementation,
Michael Goffioul <=