🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #29874

Re: big arrays in MW C

#29874
From: Daniel A. Glasser
Date: Tue, 29 Dec 1987 05:53
30 lines
1884 bytes
In article <291@stag.UUCP> trb@stag.UUCP ( Todd Burkey ) writes:
>Hi,
>  Does anyone know if MWC will safely handle large arrays now? I know
>that I had problems in the early versions with HDSCAN's arrays in that
>I had to keep the total amount of data in a particular array less than
>32K bytes. Now when I compile tests (i.e. a char[10000][12]), I get a
>message like:
>  strict: size of array overflows size_t
>
This message is just a warning -- it is because size_t is in fact an
unsigned int in MWC 2.1.7.  size_t is the default type of the result
of the sizeof operator.  MWC does support objects larger than 64K now,
and this warning is harmless unless you are passing sizeof(foo) to a
function that is expecting an int.  Sizeof is promoted to a long when
it overflows the unsigned int.  When MWC releases an ANSI conforming
(rather than K&R, which is what it conforms to now with some ANSI
extensions), size_t will become a long instead of an int, and then
this kind of warning will go away.

Even in version 2.0, external objects of > 32K were supported, they
just could not be declared.  They could be allocated with lmalloc()
and then accessed as arrays using the pointer/array equivilance.

I hope all of this helps.
-- 
					Daniel A. Glasser
					...!ihnp4!chinet!dag
					...!ihnp4!mwc!dag
					...!ihnp4!mwc!gorgon!dag
	One of those things that goes "BUMP!!! (ouch!)" in the night.
Technical Details
Message-ID: <2037@chinet.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!ptsfa!ihnp4!chinet!dag
References: <291@stag.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!ptsfa!ihnp4!chinet!dag
From: dag@chinet.UUCP (Daniel A. Glasser)
Newsgroups: comp.sys.atari.st
Subject: Re: big arrays in MW C
Message-ID: <2037@chinet.UUCP>
Date: 29 Dec 87 05:53:08 GMT
References: <291@stag.UUCP>
Reply-To: dag@chinet.UUCP (Daniel A. Glasser)
Organization: Chinet - Public Access Unix
Lines: 29
Keywords: MWC arrays C
Summary: Big arrays work fine as of 2.1.7 of MWC