mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
EVENT_INIT via a compound literal
This pacifies GCC 16.1.1 x86-64 -Warray-bounds when compiling with -fsanitize=address. It’s also cleaner on more-typical platforms. * src/termhooks.h (EVENT_INIT): Define via a compound literal rather than via a memset plus an assignment. This evaluates the argument lvalue only once, and is more likely to catch type errors.
This commit is contained in:
parent
7bfde4d50b
commit
e7a333f18e
1 changed files with 1 additions and 2 deletions
|
|
@ -411,8 +411,7 @@ struct input_event
|
|||
Lisp_Object device;
|
||||
};
|
||||
|
||||
#define EVENT_INIT(event) (memset (&(event), 0, sizeof (struct input_event)), \
|
||||
(event).device = Qt)
|
||||
#define EVENT_INIT(event) ((event) = (struct input_event) {.device = Qt})
|
||||
|
||||
/* Bits in the modifiers member of the input_event structure.
|
||||
Note that reorder_modifiers assumes that the bits are in canonical
|
||||
|
|
|
|||
Loading…
Reference in a new issue