level-zero icon indicating copy to clipboard operation
level-zero copied to clipboard

extern-c-compat warning due to empty structure

Open moksiuc opened this issue 11 months ago • 3 comments

include/layers/zel_tracing_register_cb.h:2515:9: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat] 2515 | typedef struct _zer_get_default_context_params_t | ^

moksiuc avatar Dec 17 '25 09:12 moksiuc

This turns into an error when building with clang

│B│ /mason/build/x86_64/v1.26.3.tar.gz/include/layers/zel_tracing_register_cb.h:2515:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
│B│  2515 | typedef struct _zer_get_default_context_params_t
│B│       |         ^
│B│ 1 error generated.

K1ngfish3r avatar Jan 31 '26 20:01 K1ngfish3r

This should be fixed in the associated commit. We can't technically fix the code, as it's baked into the public facing API and would change the structure size, but we've addressed the warning with #pragmas ... Please check and verify and close.

rwmcguir avatar May 06 '26 23:05 rwmcguir

Verified. Currently using your commit when building 1.28.2. Can close this

K1ngfish3r avatar May 07 '26 20:05 K1ngfish3r