Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix a bunch of Coverity-reported defects
- X-seq: zsh-workers 52247
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Fix a bunch of Coverity-reported defects
- Date: Thu, 26 Oct 2023 09:28:29 +0100 (BST)
- Archived-at: <https://zsh.org/workers/52247>
- Importance: Normal
- In-reply-to: <CAH+w=7a88XNokfYdU4kfbNUAOn_bPPYw1zoRR0im-js_xRWwHQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7a88XNokfYdU4kfbNUAOn_bPPYw1zoRR0im-js_xRWwHQ@mail.gmail.com>
> On 26/10/2023 04:36 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> A batch of the warnings that I ignored were assignments of one field
> of a union to another field of the same union, e.g., a casted long
> onto a double, etc., which elicited "overlapping copy" warnings. I'm
> fairly confident we'd have seen things crashing by now if this wasn't
> safe, but I mention it in case someone knows why it might be a
> problem.
I guess it's worried about cases where the reads are not atomic
and you might be writing back piecemeal. I can't believe this is going
to be an issue for 32-bit values, so if there was ever going to be a
problem it would be when there is a read of e.g. a long long or a double
on a 32-bit system. I rather suspect compiler writers are alive to this
sort of thing anyway.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author