Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!gatech!prism!loligo!pepke From: pepke@loligo.cc.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C Array Design Flaw Message-ID: <698@loligo.cc.fsu.edu> Date: 8 May 89 13:40:02 GMT References: <664@loligo.cc.fsu.edu> <24093@agate.BERKELEY.EDU> <696@loligo.cc.fsu.edu> Reply-To: pepke@loligo.UUCP (Eric Pepke) Organization: Supercomputer Computations Research Institute Lines: 26 In article <696@loligo.cc.fsu.edu> I write: >This is perfectly legal C, and it makes no assumptions on how big the >array is. If you have enough memory, a call to Access7(40000, 2) should >be perfectly reasonable, but it will fail. This statement of mine is nonsense, of course.Such a call is only reasonable in a C where int is defined as bigger than 16 bits. When you use Lightspeed C, as you would have to declare a and b as long integers. When you do that, you get what looks like correct code. Also, my statement that Lightspeed C would generate bad code in some cases where a syntax check would fail is also wrong. The multiplier for the first subscript is determined by dimensions 2 through N, and cases where the multiplier would be greater than 32767 would be rejected first by the test for arrays with size greater than 32767. What is will do is reject certain array declarations needlessly, as in the case of hist[32][32][32]; Eric Pepke ARPA: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: pepke@scri Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.