Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpl-opus!hpnmdla!dan From: dan@hpnmdla.HP.COM (Dan Pleasant) Newsgroups: comp.sys.mac.programmer Subject: Re: Annoying MPW C++ warning Message-ID: <450015@hpnmdla.HP.COM> Date: 20 Dec 90 17:56:08 GMT References: <450014@hpnmdla.HP.COM> Organization: HP Network Measurements Div, Santa Rosa, CA Lines: 39 In comp.sys.mac.programmer, Bruce.Hoult@bbs.actrix.gen.nz writes: > Dan Pleasant writes: > > >Does anyone know how to eliminate this annoying warning message in > >MPW C++? > > > >void foo() > >{ > > Rect r, r2; > > > > r.left = 1; > > r.right = 2; > > r.bottom = 3; > > r.top = 4; > > > > r2 = r; > >} > > > >CFront gives a "variable 'r' used before set" warning for this code. > > > Mine doesn't (MPW CFront 1.0). Once I #include , of course. > -- > Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 772 116 > BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ Well, let this be a lesson to us all. This problem popped up twice in my "real" code, and I thought I had it completely pinned down so I just posted the above code snippet. The snippet, of course, compiles perfectly. My original code (which is obviously a great deal more complicated than the snippet) still exhibits the problem. Looks like something more complicated is going on and it's back to the drawing board. *Sigh* The moral: Don't post code snippets unless you test them first! Dan Pleasant