delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/11/05:01:04

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Esa A E Peuha <esa DOT peuha AT helsinki DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Environment Variables
Date: 11 Aug 2004 11:47:04 +0300
Organization: University of Helsinki
Lines: 36
Message-ID: <86pacx283jr.fsf@sirppi.helsinki.fi>
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>
NNTP-Posting-Host: sirppi.helsinki.fi
X-Trace: oravannahka.helsinki.fi 1092214024 10765 128.214.205.27 (11 Aug 2004 08:47:04 GMT)
X-Complaints-To: abuse AT helsinki DOT fi
NNTP-Posting-Date: 11 Aug 2004 08:47:04 GMT
X-Newsreader: Gnus v5.6.43/Emacs 19.34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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.)

> 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.

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


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