KhronosGroup / OpenCL-ICD-Loader

The OpenCL ICD Loader project.
Apache License 2.0
246 stars 136 forks source link

add const to fix compiler warnings #222

Closed bashbaug closed 1 year ago

bashbaug commented 1 year ago

Fix a few warnings due to missing const:

icd_platform.h:30:25: warning: passing argument 1 of ‘khrIcdOsDirEnumerate’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   30 | #define ICD_VENDOR_PATH "/etc/OpenCL/vendors"
      |                         ^~~~~~~~~~~~~~~~~~~~~
icd_linux.c:219:26: note: in expansion of macro ‘ICD_VENDOR_PATH’
  219 |     khrIcdOsDirEnumerate(ICD_VENDOR_PATH, "OCL_ICD_VENDORS", ".icd", khrIcdVendorAdd, 0);
      |                          ^~~~~~~~~~~~~~~
...
icd_linux.c:219:43: warning: passing argument 2 of ‘khrIcdOsDirEnumerate’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  219 |     khrIcdOsDirEnumerate(ICD_VENDOR_PATH, "OCL_ICD_VENDORS", ".icd", khrIcdVendorAdd, 0);
      |                                           ^~~~~~~~~~~~~~~~~