Xref: utzoo comp.sys.amiga:75853 comp.sys.amiga.tech:17478 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!tut.cis.ohio-state.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!lth.se!newsuser From: f88ho@efd.lth.se (Hans Olsson) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: "chip" in SAS C Message-ID: <1991Jan6.121131.26367@lth.se> Date: 6 Jan 91 12:11:31 GMT References: <1991Jan4.031246.20044@cs.uoregon.edu> <1991Jan6.092515.6970@cs.uoregon.edu> Sender: newsuser@lth.se (LTH network news server) Reply-To: f88ho@efd.lth.se (Hans Olsson) Organization: Lund Institute of Technology, Sweden Lines: 31 In article <1991Jan6.092515.6970@cs.uoregon.edu> rlittle@cs.uoregon.edu (Robert A. Little) writes: [..deleted] >Two things...First: I mistyped the message--my code read: > >USHORT chip ImageData[]={0xF7000,0xEFFF,...}; > >Second: >The compiler would only compile the code if I moved it from within a procedure >to a global declaration...it compiles fine now...my only question is, Why? >Why won't it compile if the declaration is made within a procedure? Some type >of a scope problem? > Things declared inside of procedures are normally allocated from the stack, so in order to make it work the compiler would have to do the following: Allocate memory upon entry of function. Free memory then you leave the function. And maintain a list of this memory so still could exit() from the function. This is a bit more than a pair of link/unlink. I don't see any reasons why it shouldn't work it you used static chip ImageData... inside a function ,but I don't have lattice so I can't test it. -- ---------- Hans Olsson Email: f88ho@efd.lth.se Snail: K[MN[RSV[GEN 8:118 222 45 Lund Sweden