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

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



On Thu, Oct 26, 2023 at 2:19 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Thu, Oct 26, 2023 at 5:37 AM 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.
>
> This can indeed cause problems. The conditions under which it happens
> are subtle. Here's an example: https://godbolt.org/z/EvxTzM1hn.
>
>     inline int foo(int* x, float* y) {
>         *x = 1;
>         *y = 2;
>         return *x;
>     }

None of the instances flagged by coverity involved indirection through
pointers, so I suspect we're OK there.




Messages sorted by: Reverse Date, Date, Thread, Author