You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We hit a problem recently in the OpenCL-CLHPP CI where OpenCL ICD loader builds with CMAKE_C_EXTENSIONS=OFF produced anonymous union / brace initialization warnings. Because the CI builds with warnings-as-errors, this caused CI to fail.
/home/bashbaug/git/OpenCL-ICD-Loader/loader/icd_dispatch_generated.c:6828:5: warning: braces around scalar initializer
6828 | {&clGetPlatformIDs_disp},
At least on my system, the difference between CMAKE_C_EXTENSIONS=OFF and the default CMAKE_C_EXTENSIONS=ON is that compilation with extensions off passes -std=c99, whereas compilation with extensions on is done with -std=gnu99.
If we want to build with extensions off and hence with -std=c99 we should only use brace initialization when anonymous unions are supported. This may be as simple as something like: