Xref: utzoo comp.sys.amiga:76029 comp.sys.amiga.tech:17590 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!lrg7030 From: lrg7030@uxa.cso.uiuc.edu (Loren Rittle) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: "chip" in SAS C Message-ID: <1991Jan8.081022.21160@ux1.cso.uiuc.edu> Date: 8 Jan 91 08:10:22 GMT References: <1991Jan6.092515.6970@cs.uoregon.edu> <12545@hacgate.UUCP> <17211@cbmvax.commodore.com> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 48 Brian Jackson writes: > ANSI C allows the initialization of aggregate auto variables as long > as the initializers are constants (which these are.) See pages 85-86 > and page 219 of the second edition K&R. Of course, the 'chip' keyword > in SAS C makes this a bit unlikely, but the ANSI C compilers should > accept it. The following compiles and runs just fine with Aztec 5.0d: > > main() > { > int foo[] = { 0,1,2,3 } ; > int x ; > > for( x = 0 ; x < 4 ; x++ ) > printf("x = %d\n", foo[x] ) ; > } Well, I'm not sure if you are implying that SAS/C is less than ANSI C or not, but it sure sounds like it to me, so I feel I must defend it, without slamming the other guy as you decided you had to. First off, the above code compiles and runs just fine under SAS/C also. With the strict ANSI switch (-ca) turned on, SAS will disallow the chip (and other Amiga extension) keywords, but will still allow the __chip, __far, etc. versions of these keywords as allowed under ANSI. Of course, the reason void main(void) { short __chip ImageData[] = {0xffff, 0x0000, 0xffff, 0x0000}; } is flagged as an error is that you have no idea during compile time whether the stack will be located in CHIP RAM or not (Let's hope not!). To futher explain, we know auto variables *must* go on the stack and we know that things specified as __chip items *must* go in CHIP RAM. The compiler sees at compile time that these two conditions can most likely not be satisfied at run time and *must* flag it as an error. OK, I will take one quick poke at Manx, do you guys using Manx really have to suffer without a __chip keyword? ATOM and putting chip data in separate source files (and using special compiler switches) went out of vogue years ago :-). OK, how many of you really even know what ATOM is? (I guess all the Aztec guys... :-) Send mail and I will summarize. Loren J. Rittle -- ``In short, this is the absolute coolest computer device ever invented!'' -Tom Denbo speaking about The VideoToaster by NewTek ``Think about NewTek's VideoToaster! Now think about the Amiga!'' Loren J. Rittle lrg7030@uxa.cso.uiuc.edu