init1.C failure under study
Robert Lipe
robertl@dgii.com
Sat Nov 29 09:29:00 GMT 1997
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();
}
More information about the Gcc
mailing list