xf86drm: Fix type-punned pointer build warning
PATCH 1/1 xf86drm: Fix type-punned pointer build warning
From: Thierry Reding <[email protected]>
CC libdrm_la-xf86drmMode.lo
../xf86drmMode.c: In function 'drmHandleEvent':
../xf86drmMode.c:854:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
e = (struct drm_event *)(&buffer[i]);
^
--- xf86drmMode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xf86drmMode.c +1 -1
@@ -901,7 +901,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx) i =0 ;while (i < len) { - e = (struct drm_event *) &buffer[i]; + e = (struct drm_event *)(buffer + i);switch (e->type) {case DRM_EVENT_VBLANK : if (evctx->version < 1 ||
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Thierry Reding
From: Thierry Reding <[email protected]>
CC libdrm_la-xf86drmMode.lo
../xf86drmMode.c: In function 'drmHandleEvent':
../xf86drmMode.c:854:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
e = (structdrm_event*)(&buffer[i]);
^Signed-off-by Thierry Reding <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99350
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel