Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!visix!news From: brett@visix.com (Brett Bourbin) Newsgroups: comp.sys.amiga.programmer Subject: Re: Manx vs. SAS/Lattice Message-ID: <1991Apr19.193033.13587@visix.com> Date: 19 Apr 91 19:30:33 GMT References: <9104021420.AA10848@thunder.LakeheadU.Ca> Sender: news@visix.com Reply-To: brett@visix.com Organization: Visix Software Inc, Reston, VA 22091 Lines: 46 In article , stephen@cia.docs.uu.se (Stephen Cooper) writes: > Yet another bug in AztecC 5.0d: (YABIAC? :-) > Compiling this: > > void > DrawCurves (void) > { > SHORT xy[MAXPOINTS * 2]; > struct Border BezierBorder = > {0, 0, 1, 0, COMPLEMENT, MAXPOINTS, &xy, NULL}; > > get_polypoints (DrawBezier, Bezier_Window, &BezierBorder); > return; > } > > will give internal error #40, while compiling this: > > void > DrawCurves (void) > { > SHORT xy[MAXPOINTS * 2]; > struct Border BezierBorder = > {0, 0, 1, 0, COMPLEMENT, MAXPOINTS, NULL, NULL}; > > BezierBorder.XY = xy; > get_polypoints (DrawBezier, Bezier_Window, &BezierBorder); > return; > } > > is OK. What gives? I mean really -- Internal errors??? > For that?!?! Yes, for that. It looks like "xy" is declared in a procedure and is a local variable, which means it will be allocated when you call the routine, from the stack. Now, you then try to take the address of a item that will be on the stack. A no-no. You can either make the "xy" array "static" so it will not be on the stack, or you could pull it outside the DrawCurves() function and make it global (yech!). Hope this helps. > stephen@jfk.docs.uu.se -- __ Brett Bourbin \ / /(_ /\/ 11440 Commerce Park Drive ..!uunet!visix!brett \/ / __)/ /\ Reston, Virginia 22091 brett@visix.com Software Inc (703) 758-2733