Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!mizar.docs.uu.se!perm From: perm@mizar.docs.uu.se (Per Mildner) Newsgroups: gnu.g++.bug Subject: sizeof and uninitialized args Message-ID: <8905290340.AA15665@mizar.DoCS.UU.SE> Date: 29 May 89 03:40:04 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36 I'm Per-Mildner@AIDA.CSD.UU.SE Configuration: SUN 4 with OS 4 tm.h -> config/tm-sparc+.h md -> config/sparc.md g++ version 1.35.0 g++ -Wall -O program.cc In method struct C *C::C (): sizeof-bug.cc:17: field `r' used before initialized (after assignment to `this') // -*- Mode:C++ -*- // This file: sizeof-bug.cc class B { public: int x; B() {} B(B& init) { x = init.x; } }; class C { public: B r[1]; C() { this = (C*) new char[sizeof r]; // *** Shouldn't care if initialized? } }; int main (int argc, char* argv[]) { return 0; };