__kernel void PrintfWarning()
long i = get_global_id(0);
When I compile above code, compiler said:
line 5: warning: argument
of type "const __constant char *" is incompatible with parameter of
type "__constant char *"
How can I fix this?
I don't have to fix but just ignore?
Didn't you get any warnings from compiler?
I know there was nothing wrong because it's not an error but just a warning, except with "-Werror".
This appears to be a defect in the compiler.
I have created a bug report. (For my reference 359250).
If the diagnostic is troublesome, you can insert a cast to quiet it.
printf((__constant char *)"%d\n", i);
Any news on this? I'm still seeing the spurious warning on AMD Platform Version "OpenCL 1.2 AMD-APP (1526.3)". I know there's a trivial workaround so this bug probably has low priority, but it seems also trivial to fix ...
It only tells about the error, if other errors are found - in practise it's handled as a warning. But it should be fixed anyway because of the Peter-and-the-wolf effect.
When I checked it using latest catalyst Omega driver (14.12) and CodeXL 1.6 on Windows 7(64 bit), I found that its compiling fine without any warning for every gpu devices except cpu (see the attached file). I got the same warning only for cpu device. Please confirm whether you've similar observation or not. Meanwhile, I'll check the status of that bug report and if required, will wake it up again or create a new one.