summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2026-05-23 18:48:45 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2026-05-23 19:18:54 -0700
commite7a333f18e96fc88d98e574be5c8e355efa96c36 (patch)
treeb8e2b7fe021f8ec5cd6f51e8016ca70f731b3b64
parent7bfde4d50b5e188211e5154a735619905e2a734d (diff)
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.
-rw-r--r--src/termhooks.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/termhooks.h b/src/termhooks.h
index 38c9df9cad2..ebac777ab4c 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -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