X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Esa A E Peuha 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: <41115A5F DOT 7DDC6318 AT yahoo DOT com> <41127AF9 DOT 26DEA37C AT yahoo DOT com> <4112BE04 DOT 3B151CA1 AT yahoo DOT com> <7494-Fri06Aug2004121205+0300-eliz AT gnu DOT org> <86p1xifjnyj DOT fsf AT sirppi DOT helsinki DOT fi> 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 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/