[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiler warnings in dispnew.c
From: |
Stefan Monnier |
Subject: |
Re: Compiler warnings in dispnew.c |
Date: |
Mon, 29 Nov 2021 12:49:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Andreas Schwab [2021-11-28 12:07:01] wrote:
> - memcpy (&to->x, &from->x, sizeof *to - off);
> + memcpy ((char *) to + off, (char *) from + off, sizeof *to - off);
I wonder: is the (char*) cast sufficient or is it necessary to
"obfuscate" the code by writing `to + off` instead of `&to->x`?
[ By "obfuscate" I mean here to hide from the compiler, rather than from
humans, because I'm not sure which of the two is more clear to
a human, here. ]
Stefan
Re: Compiler warnings in dispnew.c, Eli Zaretskii, 2021/11/28
Re: Compiler warnings in dispnew.c, Po Lu, 2021/11/28