We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should add -Wcast-qual to our CI builds to catch casting problems in the future.
Originally posted by @haonanya in #241 (comment):
Which compiler / compiler flags did you use to find these issues? Is this something we could have caught via CI?
gcc uses -Werror -Wcast-qual build fail:
[haonanya]$ /usr/bin/gcc -DCL_ENABLE_LAYERS -DCL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES -DCL_TARGET_OPENCL_VERSION=300 -DOPENCL_ICD_LOADER_VERSION_MAJOR=3 -DOPENCL_ICD_LOADER_VERSION_MINOR=0 -DOPENCL_ICD_LOADER_VERSION_REV=6 -DOpenCL_EXPORTS -I/export/users/haonanya/OpenCL-CTS/OpenCL-Headers -I/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/build -I/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader -fPIC -std=gnu99 -Werror -Wcast-qual -MD -MT CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o -MF CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o.d -o CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o -c /export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c /export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c: In function ‘compareDirElem’: /export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c:132:21: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] 132 | return strcoll(((struct dirElem *)a)->d_name, ((struct dirElem *)b)->d_name); | ^ /export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c:132:52: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual] 132 | return strcoll(((struct dirElem *)a)->d_name, ((struct dirElem *)b)->d_name); | ^ cc1: all warnings being treated as errors
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should add -Wcast-qual to our CI builds to catch casting problems in the future.
Originally posted by @haonanya in #241 (comment):
gcc uses -Werror -Wcast-qual build fail:
[haonanya]$ /usr/bin/gcc -DCL_ENABLE_LAYERS -DCL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES -DCL_TARGET_OPENCL_VERSION=300 -DOPENCL_ICD_LOADER_VERSION_MAJOR=3 -DOPENCL_ICD_LOADER_VERSION_MINOR=0 -DOPENCL_ICD_LOADER_VERSION_REV=6 -DOpenCL_EXPORTS -I/export/users/haonanya/OpenCL-CTS/OpenCL-Headers -I/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/build -I/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader -fPIC -std=gnu99 -Werror -Wcast-qual -MD -MT CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o -MF CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o.d -o CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o -c /export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c
/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c: In function ‘compareDirElem’:
/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c:132:21: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
132 | return strcoll(((struct dirElem *)a)->d_name, ((struct dirElem *)b)->d_name);
| ^
/export/users/haonanya/OpenCL-CTS/OpenCL-ICD-Loader/loader/linux/icd_linux.c:132:52: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
132 | return strcoll(((struct dirElem *)a)->d_name, ((struct dirElem *)b)->d_name);
| ^
cc1: all warnings being treated as errors
The text was updated successfully, but these errors were encountered: