From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Reading environment variables in ADA?
Date: 1998/10/13
Date: 1998-10-13T00:00:00+00:00 [thread overview]
Message-ID: <x7vaf31ovyz.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: EACHUS.98Oct7154628@spectre.mitre.org
eachus@spectre.mitre.org (Robert I. Eachus) writes:
> In article <6vfgvo$ja0$1@nnrp1.dejanews.com> dewarr@my-dejanews.com writes:
>
> > I find this a specious argument, it would equally well apply to constants
> > at the global level which you allowed C to modify, and there is no way of
> > generating inefficient code to allow this to "work" whatever that means.
>
> > A constant is a constant, it cannot be modified after declaration
> > time. If you have your C code modify it that is morally equivalent
> > to having C destroy your Ada generated code by poking at it. This
> > is just plain junk buggy code, and it is absurd to generate
> > deliberately suboptimal code so that this particularly bug can be
> > got away with!
>
> Agreed, it is absurd, but it is also, unfortunately, practical
> advice, especially in the case of environment variables. (See the
> man page from SunOS atttached.) I don't like creating storage leaks,
> but the Ada version of putenv I use explicitly allocates heap space
> and forgets about it after the return. Much easier than finding the
> insidious bugs caused when it is called with a stack or constant
> value.
[putenv man page snipped]
and I recently got bitten by openlog on Solaris for the same reason.
However, I certainly don't think that compilers should generate
inefficient code because of potential OS/library problems like this, as
Robert seemed to say; programmers may have to write inefficient code,
of course.
next prev parent reply other threads:[~1998-10-13 0:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-09-12 0:00 Reading environment variables in ADA? Stefan Lingdell
1998-09-12 0:00 ` David C. Hoos, Sr
1998-09-13 0:00 ` Steven Hovater
1998-09-17 0:00 ` Gisle S{lensminde
1998-10-06 0:00 ` Matthew Heaney
1998-10-06 0:00 ` dewarr
1998-10-06 0:00 ` Robert I. Eachus
1998-10-07 0:00 ` dewarr
1998-10-07 0:00 ` Robert I. Eachus
1998-10-13 0:00 ` Simon Wright [this message]
1998-09-17 0:00 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox