Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #164578
| Path | csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Sequencing guarantees for macro versions of standard functions |
| Date | Mon, 24 Jan 2022 07:27:04 -0800 |
| Organization | A noiseless patient Spider |
| Lines | 34 |
| Message-ID | <864k5tnohj.fsf@linuxsc.com> (permalink) |
| References | <ssct1k$651$1@dont-email.me> <86k0euq62t.fsf@linuxsc.com> <87lez6xeld.fsf@nosuchdomain.example.com> <868rv5oldy.fsf@linuxsc.com> <ssl80r$h8r$1@dont-email.me> <ssl84t$h8r$2@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | reader02.eternal-september.org; posting-host="d742d26243a9575adb46fc0e29496190"; logging-data="3706"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XzL7hm22/JoTrC/NZGSepX2uWPrwCVTw=" |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) |
| Cancel-Lock | sha1:bHr6ofIO3uQSep45JGCSFFUnMh4= sha1:ePoNpg1FG4b5JBFRI+pXdL/utlo= |
| Xref | csiph.com comp.lang.c:164578 |
Show key headers only | View raw
Andrey Tarasevich <andreytarasevich@hotmail.com> writes:
> On 1/23/2022 7:56 PM, Andrey Tarasevich wrote:
>
>> On 1/23/2022 7:36 PM, Tim Rentsch wrote:
>>
>>> However, the suggested rewrite has different semantics than the
>>> previous single assignment with function call. If we want to
>>> keep the same semantics but still be able to use the macro
>>> form (but without any sequencing issues), a different writing
>>> is needed, as for example
>>>
>>> x = modf( x, (double[]){ 0 } );
>>>
>>> Writing the call this way should make it obvious that the value
>>> stored in/through the second argument is ignored and discarded.
>>
>> That would be
>>
>> x = modf( x, &(double[]){ 0 } );
>
> Opps, my sitake. Sorry, I missed the `[]` part.
>
> Of course, your original variant is correct. Although I don't see
> the point of bringing arrays into the picture. One can just do
>
> x = modf( x, &(double){ 0 } );
For no particular reason I can point to (no pun intended), in
situations like this one I normally use the array type form in
preference to the & form. I find it easier to digest, and also
think it expresses more directly what I want to convey. I'm sure
many people would normally use the & form, and I'm okay with that
choice, but it doesn't change my choice.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Sequencing guarantees for macro versions of standard functions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-01-20 15:59 -0800
Re: Sequencing guarantees for macro versions of standard functions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-20 16:35 -0800
Re: Sequencing guarantees for macro versions of standard functions Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-01-23 14:38 -0800
Re: Sequencing guarantees for macro versions of standard functions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-23 19:36 -0800
Re: Sequencing guarantees for macro versions of standard functions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-01-23 19:56 -0800
Re: Sequencing guarantees for macro versions of standard functions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-01-23 19:58 -0800
Re: Sequencing guarantees for macro versions of standard functions Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-01-23 23:50 -0800
Re: Sequencing guarantees for macro versions of standard functions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-24 07:27 -0800
Re: Sequencing guarantees for macro versions of standard functions Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-01-23 23:49 -0800
Re: Sequencing guarantees for macro versions of standard functions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-24 07:31 -0800
Re: Sequencing guarantees for macro versions of standard functions Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-01-24 13:18 -0800
Re: Sequencing guarantees for macro versions of standard functions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-29 03:36 -0800
csiph-web