Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Libraries using longjmp for error handling
Date: Fri, 29 Sep 2023 08:19:37 -0700
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <86pm21f1me.fsf@linuxsc.com>
References: <65SQM.565977$9o89.411905@fx05.ams4> <20230928160237.9796f1896cb0be293bd24b76@gmail.moc> <87jzsae7jm.fsf@bsb.me.uk> <20230928183129.fb386b543c40cd56340ca40f@gmail.moc> <878r8qdufu.fsf@bsb.me.uk> <20230928130843.804@kylheku.com> <87il7uc7q4.fsf@bsb.me.uk> <20230928155123.960@kylheku.com> <20230929172303.8828ee9f53666282c58bdb0a@gmail.moc>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="13636bbb038e3a1f79d11dd50eec8409"; logging-data="358958"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vS54o8XoFo1LOULnAqDEgkdxPX24cd98="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:9xedAJDe8hvMJBnYF0DdpwFbThg= sha1:Ka1zWPHmR6HJUuqsru3+RzZr1lA=
Xref: csiph.com comp.lang.c:176743
Anton Shepelev writes:
> Kaz Kylheku to Ben Bacarisse:
>
>>> OK, I see the point -- the ptr member in the returned
>>> value is sort of an anonymous object -- but in my
>>> opinion it's a stretch.
>>
>> I think the point is that Anton should find the existence
>> of all anoymous temporary objects repugnant, not just the
>> more recently introduced ones.
>
> In that case, I see it as more or less a named object, its
> name being the `ptr' field qualified by the function
> invocation. Otherwise, I should find repugnant even simple
> expressions, like:
>
> res = sqr(x) + sqr(y);
>
> where the return value of sqr() is techically some sort of
> anonymous object, right? [...]
No, it isn't. The result of calling sqr(x) is a value, not
an object. All objects have an address; the result of sqr(x)
does not. In an expression like 3+4, the 3 and the 4 are
values, not objects. That is one reason why the distinction
between constants, which are values and not objects, and
literals, which are anonymous objects, is important.