[Aldor-l] Compiling setup
Christian Aistleitner
tmgisi at gmx.at
Sun Aug 13 06:06:13 EDT 2006
Hello Stephen,
On Sun, 13 Aug 2006 00:55:29 +0200, Stephen Watt <watt at scl.csd.uwo.ca>
wrote:
> Laurentiu, I think there is more to this than meets the eye.
you are probably right. We cannot judge, as we do not have access to the
sources.
However, according to the AUG, a Literal is a constant. According to the
discussion, we all agree constants are correctly modelled by
char * str = "my_fancy_literal".
To my understanding, this is basically, what Aldor does at the moment.
This is a sound behaviour -- No one wants to change the representation of
string literals.
The aldor library currently assumes that the literal is in a read-write
memory location and can be modified in-place. Assuming that a constant
(i.e.: the literal) is in read-write memory is a bad choice. Assuming to
modify a constant in-place is even further off.
However, the aldor library should/has to assure that the returned value is
in read-write memory.
Its no big deal to implement this behaviour in the string$String function
by adding a "copy" (as I showed).
> The Aldor system developers are not the only ones to write libraries --
> the compiler should have correct behaviour for any legitimate Aldor code
> and not break depending on the underlying C compiler.
If other libraries make the same assumption, it should be the problem of
these libraries, and not of the Aldor compiler.
The current compiler has correct behaviour for legitimate Aldor code.
However, the aldor library makes assumptions that do not hold for current
gccs.
However, we cannot inspect the run-time system. Maybe there the assumption
can be found as well...
--
Kind regards,
Christian
More information about the Aldor-l
mailing list