Skip to content

radeon: fix some strict-aliasing warnings in radeon_drm_winsys.c

Filip Gawin requested to merge gawin/mesa:radeon/strict-aliasing into main
[1864/2485] Compiling C object src/gallium/winsys/radeon/drm/
libradeonwinsys.a.p/radeon_drm_winsys.c.o
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c: In function
‘radeon_drm_get_gpu_reset_counter’:
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:689:57:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  689 |                         "gpu-reset-counter",
(uint32_t*)&retval);
      |                                                         ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c: In function
‘radeon_query_value’:
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:719:39:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  719 |                            (uint32_t*)&retval);
      |                                       ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:727:58:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  727 |                            "num-bytes-moved",
(uint32_t*)&retval);
      |                                                          ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:739:53:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  739 |                            "vram-usage", (uint32_t*)&retval);
      |                                                     ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:743:52:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  743 |                            "gtt-usage", (uint32_t*)&retval);
      |                                                    ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:747:51:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  747 |                            "gpu-temp", (uint32_t*)&retval);
      |                                                   ^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:751:59:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  751 |                            "current-gpu-sclk",
(uint32_t*)&retval);
      |
^~~~~~~
../gawin/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c:755:59:
warning: dereferencing type-punned pointer will break strict-aliasing
rules [-Wstrict-aliasing]
  755 |                            "current-gpu-mclk",
(uint32_t*)&retval);
      |
^~~~~~~

Merge request reports

Loading