Xref: utzoo comp.sys.amiga:75997 comp.sys.amiga.tech:17576 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!hacgate!SDFSUN1!johnl From: johnl@SDFSUN1.hac.com (John Lee) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: "chip" in SAS C Message-ID: <12545@hacgate.UUCP> Date: 7 Jan 91 22:58:07 GMT References: <1991Jan4.031246.20044@cs.uoregon.edu> <1991Jan6.092515.6970@cs.uoregon.edu> Sender: news@hacgate.UUCP Reply-To: johnl@SDFSUN1.hac.com (John Lee) Organization: Hughes Aircraft Co., El Segundo, CA Lines: 25 In article <1991Jan6.092515.6970@cs.uoregon.edu> rlittle@cs.uoregon.edu (Robert A. Little) writes: >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? Aha! There's the rub... You cannot initialize aggregate automatic variables. You'll need to make it static by: 1) moving it outside the procedure, making it global, or 2) inserting the storage class keyword 'static' in front. I still think the SAS/C error message is oblique. I hate it when programs do that. ------------------------------------------------------------------------------- The crew faces deadly GURUs! Next time on AmigaDOS: The Next Generation. +--------+ John Lee | HUGHES | +--------+ ARPAnet: jhlee@hac2arpa.hac.com Hughes Aircraft Company The above opinions are those of the user and not of those of this machine.