🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49642

Re: forced memeory location of variables

#49642
From: ps
Date: Tue, 18 Jan 1994 07:45
23 lines
1246 bytes
Charles Wilson (charliew@sunshine.LABS.TEK.COM) wrote:
: I would like to have a group of global variables end up adjacent to one another in memory
: as was declared in th source code.  Does anyone have a way of doing this?  I don't want to
: place them to be in a struct.  Can anyone tell me the code that reserves storage fo the
: declared variables.  Maybe I can make a modification.

Why not use something like this?

struct {
	int	val1 ;
	int	val2 ;
	} x ;

#define	val1	(x.val1)
#define	val2	(x.val2)

Cheese,

/Serge.P

--

Russian guy from the Zurich university...
Technical Details
Message-ID: <1994Jan18.074530.13787@rzu-news.unizh.ch>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!rzusuntk.unizh.ch!ocisgi7!ps
References: <6094@crl.LABS.TEK.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,61ed295a53b3785a
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-01-18 02:15:11 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!rzusuntk.unizh.ch!ocisgi7!ps
From: ps@ocisgi7.unizh.ch ()
Subject: Re: forced memeory location of variables
Message-ID: <1994Jan18.074530.13787@rzu-news.unizh.ch>
Sender: newsadm@rzu-news.unizh.ch (CNEWS ADMINISTRATION)
Organization: University of Zurich, Switzerland
X-Newsreader: TIN [version 1.2 PL2]
References: <6094@crl.LABS.TEK.COM>
Distribution: gnu
Date: Tue, 18 Jan 1994 07:45:30 GMT
Lines: 24