[clang] [OpenCL] Diagnose error for zero-length array (PR #193163)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 21 09:48:21 PDT 2026
AaronBallman wrote:
> > @svenvh do you know if other OpenCL compilers also support this extension or is this unique to Clang? (Trying to gauge how disruptive this change is likely to be in practice.)
>
> Most OpenCL compilers I'm aware of are based on Clang. That said, I don't expect rejecting zero-length arrays will be disruptive in practice. The OpenCL kernel environment doesn't really provide the other means to effectively use zero-length/flexible arrays (lack of heap, memory is managed externally to OpenCL kernels). I'm also not aware of any official Khronos extensions that cancel the explicit flexible array restriction from OpenCL C s6.11.d.
>
> Adding a release note is a good suggestion, but I think supporting the previous behaviour with a warning will not provide any value in practice.
Thank you! Then I think a release note in the potentially breaking changes section makes sense. If people come out of the woodwork about the behavioral change, we can address it at that time.
https://github.com/llvm/llvm-project/pull/193163
More information about the cfe-commits
mailing list