Hi I have this problem and I'm not sure if it's a bug but I guess you can help me... class x{ public: x(){printf("cok %p\n",this);} ~x(){printf("dok %p\n",this);} }; static struct _a{ int a; x b; }a[]={ {1} }; int main(void){ x a; return 0; } the result: cok 0022FF14 cok 0022FF40 dok 0022FF40 dok 0040800C //<-- what??? Regards
you have two problems, one is that the code won't compile because you're missing a header, the second is that GCC 3.4.5 is ancient, so although this does appear to be a bug it will never be fixed in GCC 3.4 (it's already fixed in current releases)
Also I think he forgot about copy constructor happening.
(In reply to comment #1) > you have two problems, one is that the code won't compile because you're > missing a header, the second is that GCC 3.4.5 is ancient, so although this > does appear to be a bug it will never be fixed in GCC 3.4 (it's already fixed > in current releases) Yes, the thing is that all my projects are working over GCC 3.4.5 and my attempts to ports to 4.x was with problems, in conclusion, I have to migrate to GCC 4.x or there is a chance to fix? Regards
GCC is open source so you can attempt to fix it yourself or pay someone to do it for you, but it will never be fixed in the official GCC 3.4 because that release series is discontinued and unsupported
ha, ok, thanks.