[PATCH 06/11] Sptr: avoided potentially undefined behaviour.

Max Romanov max.romanov at gmail.com
Thu Jun 16 19:24:21 UTC 2022

There is no side effects. It's just an 'offset to self' calculation.


-----Original Message-----
From: Andrew Clayton <andrew at digital-domain.net>
To: Alejandro Colomar <alx.manpages at gmail.com>
Cc: unit at nginx.org
Sent: чт, 16 июн. 2022 20:43
Subject: Re: [PATCH 06/11] Sptr: avoided potentially undefined behaviour.

On Thu, 16 Jun 2022 17:32:22 +0200
Alejandro Colomar <alx.manpages at gmail.com> wrote:

> Hmmm, AFAIR, `u.a = u.b + 1;` is fine, since the = creates a sequence 
> point, isn't it?
> <https://stackoverflow.com/a/33291213/6872717>

So we're saying that

    6.5.16 (p3):

    [...] The side effect of updating the stored value of the left operand
    is sequenced after the value computations of the left and right operands.

makes it OK?


unit mailing list -- unit at nginx.org
To unsubscribe send an email to unit-leave at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20220616/f6d5b96f/attachment.htm>

More information about the unit mailing list