Files
xserver/Xi
dec05eba 2f66431927 xi: Fix build on arch linux (cast between struct and union gcc error)
Fixes this build error on arch linux:

../Xi/exevents.c:1394:26: error: array subscript ‘InternalEvent {aka union _InternalEvent}[0]’ is partly outside array bounds of ‘DeviceEvent[1]’ {aka ‘struct _DeviceEvent[1]’} [-Werror=array-bounds=]
 1394 |                 evtype = GetXI2Type(ev->any.type);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
../Xi/exevents.c: In function ‘DeliverEmulatedMotionEvent’:
../Xi/exevents.c:1571:17: note: object ‘motion’ of size 432
 1571 |     DeviceEvent motion;
      |

which happens because of change in build options compared to master and gcc 15.1 in arch. I think this warning (and error) is a bug in gcc.

gcc 15.1 doesn't like when struct DeviceEvent is cast to union InternalEvent.
InternalEvent has a union any type and DeviceEvent type and these have to have a matching structure (for the header part).
When the InternalEvent is used in RetrieveTouchDeliveryData function it access the any field, which accessed the data defined previously in the device_event fields.
This change matches how its done in touch.c TouchEmitTouchEnd for example and it's "more correct",
since we are no longer casting from a smaller struct (DeviceEvent) to a larger struct (InternalEvent) when calling RetrieveTouchDeliveryData.

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 19:08:17 +02:00
..
2025-06-12 16:17:35 +02:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2025-02-06 22:28:52 +00:00
2025-02-06 22:28:52 +00:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2025-06-12 16:17:35 +02:00
2025-02-06 22:28:52 +00:00
2025-02-06 22:28:52 +00:00
2025-02-06 22:28:52 +00:00
2025-02-06 22:28:52 +00:00
2025-06-12 17:21:46 +02:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2025-06-12 16:17:35 +02:00
2012-03-21 13:54:42 -07:00
2024-10-10 13:38:31 +00:00
2025-06-12 16:53:43 +02:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2012-03-21 13:54:42 -07:00
2024-09-01 22:21:12 +00:00