Mail Archives: djgpp/1997/11/04/12:16:43
eyal DOT ben-david AT aks DOT com wrote:
> I think that this sample should be checked with g++ on
> unix, to see if it is DJGPP specific problem.
I just tested it with that exact program using GCC 2.7.2.2
on DEC Alpha (OSF/1), and it works:
$ cat > 1.cc
#include <stdio.h>
class A
{
private:
FILE *fl;
public:
A(void)
{
fl = fopen("test.log", "wt");
fprintf(fl, "In A constructor\n");
}
~A(void)
{
fprintf(fl, "In A destructor\n");
fclose(fl);
}
};
A a;
int main(void)
{
return 0;
}
$ gcc 1.cc
$ ./a.out
$ cat test.log
In A constructor
In A destructor
$ gcc --version
2.7.2.2
It seems to be therefore a DJGPP bug (in the library? I'm
not sure which bit of it the startup/exit code is in).
Chris C
- Raw text -