Clarification on event_t usage in OpenCL specification
Could I have clarification on the use of event_t in OpenCL. I've seen uses similar to doSomething((event_t)0), which tip Clang in OpenCL mode rejects. It will accept if you pass '0' to a function that takes an event_t type, like doSomething(0), but not if you try and explicitly cast the value.
The specification does not mention that you can actually cast between '0' and event_t types, it only says that the builtin functions that take event_t's must accept '0' as the event_t value. The specification sections Implicit Conversions and Explicit Casts it doesn't mention event_t - so can I safely assume that the behaviour of explicitly casting 0 to event_t (by doing (event_t)0) should be banned?
Do note that the conformance tests for OpenCL 1.2 and 2.0 both use an explicit cast "(event_t)0". This is in basic/test_async_copy.cpp and basic/test_async_strided_copy.cpp. If one assumes that the tests themselves represent what is allowed in the spec, then an explicit cast of zero is allowed.
But this still does not clear the issue over non-zero values. Are those allowed? Clearly, the meaning of a non-zero value is entirely implementation-defined, and the use is non-portable. But is it also illegal, if we go by the letter of the spec?