how to correct types or cast?

I copied this code from somewhere and remake it, problem is that the OpenCL types cl_ulong makes problem when I want to print memory size,

1
2
3
4
5
6
7
8
cl_uint buf_uint;
cl_ulong buf_ulong;
if ( err != CL_SUCCESS) printf("fail: %d\n", err);
else printf("  DEVICE_GLOBAL_MEM_SIZE = %llu\n", (unsigned long long)buf_ulong);
err = clGetDeviceInfo(deviceID, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(buf_ulong), &buf_ulong, NULL);
if ( err != CL_SUCCESS) printf("fail: %d\n", err);
    else printf("  CL_DEVICE_LOCAL_MEM_SIZE = %llu\n", (unsigned long long)buf_ulong);


The warnings are:
unknown conversion type character 'l' in format [-Wformat]|
and
too many arguments for format [-Wformat-extra-args]|

What I do wrong?
Last edited on
Topic archived. No new replies allowed.