Sujet : Re: relearning C: why does an in-place change to a char* segfault?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 04. Aug 2024, 02:05:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8mk3t$3n2rq$4@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Pan/0.159 (Vovchansk; )
On Fri, 2 Aug 2024 22:01:21 -0400, Richard Damon wrote:
... was based on the fact that all arguments were pass by reference ...
Slightly more subtle than that: simple variables (and I think array
elements) were passed by reference; more complex expressions had their
value stored in a temporary and the temporary was passed by reference.
The “more complex” criterion could be triggered by something as simple as
putting an extra pair of parentheses around a variable reference.
It was a calling convention that really made no logical sense.