delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/11/12:00:54

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.131.211
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Environment Variables
Organization: Systematic Software
Message-ID: <06ekh09581ebrpqnf0n3u8gtebjal9ccfs@4ax.com>
References: <cepqfs$jts AT odak26 DOT prod DOT google DOT com> <vY6Qc.33228$vX4 DOT 11673 AT cyclops DOT nntpserver DOT com> <41115A5F DOT 7DDC6318 AT yahoo DOT com> <bNtQc.58210$vX4 DOT 56203 AT cyclops DOT nntpserver DOT com> <41127AF9 DOT 26DEA37C AT yahoo DOT com> <4112BE04 DOT 3B151CA1 AT yahoo DOT com> <7494-Fri06Aug2004121205+0300-eliz AT gnu DOT org> <ufn7h0p3s00qq4vqmq3odgnt67i4hisdfn AT 4ax DOT com> <86p1xifjnyj DOT fsf AT sirppi DOT helsinki DOT fi> <k8oih0hl2p0410fn9oobcrnvfp28dhhv01 AT 4ax DOT com> <86pacx283jr DOT fsf AT sirppi DOT helsinki DOT fi>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 44
Date: Wed, 11 Aug 2004 15:57:43 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw1no 1092239863 24.71.223.147 (Wed, 11 Aug 2004 09:57:43 MDT)
NNTP-Posting-Date: Wed, 11 Aug 2004 09:57:43 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On 11 Aug 2004 11:47:04 +0300 in comp.os.msdos.djgpp, Esa A E Peuha
<esa DOT peuha AT helsinki DOT fi> wrote:

>Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid> writes:
>
>> Looks like you're correct about -Cg not being entirely truthful about
>> globals without leading _. The revised list of non-Standard globals
>> from a dummy program with no #includes compiled with -ansi -pedantic
>> are: 
>> 
>> T _close	close	*
>> D _edata	edata
>> B _end		end
>> B _environ	environ
>> T _etext	etext
>> T _sbrk		sbrk	*
>> 
>> where the routines marked * are Unix compatible routines called by the
>> startup/exit code. Can be worked around, as you indicate below? 
>
>What version of djgpp are you using?  It seems to be older than the
>current CVS, because with it you shouldn't see _etext, _edata and _end
>unless you actually use them in your code.  (close and sbrk are bugs,
>but they may be fixed already.)

djdev 2.03 PL 2

>> Eli Z pointed out that it must be available for POSIX compatible code
>> that requires it, but should not be present for ANSI compiles. 
>> I would be interested in how you can have it defined, if it is
>> declared, but not defined as a global, and have it not be defined if
>> it is already defined? 
>
>The linker can be instructed (by using the PROVIDE construct in the
>linker script) to define symbols only if they are referenced but not
>defined.  That's how _etext, _edata and _end are defined.

That's a useful facility that I didn't know was possible. 

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian dot Inglis at SystematicSw dot ab dot ca)
    fake address		use address above to reply

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019