clGetProgramBuildInfo has a pointer size_t *param_value_size_ret. The specification reads "param_value_size_ret returns the actual size in bytes of data copied to param_value. ". Either the description is incomplete or we have no way of knowing the size we need before attempting a call.
I think it should read something like “param_value_size_ret returns the actual size in bytes of data to be copied to param_value.” This is purpose of size_t *param_value_size_ret in any clGet…Info function so you can call it again with that returned value as the size_t param_value_size argument and (void *) param_value having been properly allocated if needed.
There’s now a public bugzilla to track this issue.