Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix a bunch of Coverity-reported defects



> 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