This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
init1.C failure under study
- To: egcs at cygnus dot com
- Subject: init1.C failure under study
- From: Robert Lipe <robertl at dgii dot com>
- Date: Sat, 29 Nov 1997 11:27:37 -0600
This test works on OpenServer ELF, but not COFF. Whether this is
something in the way sco5.h handles initializers, I can't tell.
If I remove the word 'static' in the function f, this test passes
under COFF. It also makes more of a difference in the assembly
than I'd have guessed. This is one of only two g++ tests (p2736.C
is the other)that fails in COFF that doesn't fail in ELF.
Are there any other x86 COFF targets represented on the list?
Can anyone offer good hints where to look?
I stated earlier that this started failing around 1101. That
is incorrect. I just fixed the test fixture on 1101 and the
earlier results were the ones that printed "-mcoff" on the headers
but never bothered to pass it down to GCC. So this problem likely
has tenure.
Thanx,
RJL
int count;
extern "C" void _exit(int);
struct C {
~C() { if (count != 1) _exit(1); }
} c;
class A {
public:
~A () { ++count; }
};
void f() {
static A a;
}
void g() {
// Since this isn't constructed, we can't destruct it.
static A a;
}
int main () {
f();
}