[PATCH] D131307: [Clang] Allow downgrading to a warning the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 17:26:56 PDT 2022


shafik added a comment.

In D131307#3708413 <https://reviews.llvm.org/D131307#3708413>, @ronlieb wrote:

> hi, latest commit seems to have broken buildbot  for amdgpu
> https://lab.llvm.org/buildbot/#/builders/193/builds/16651

This looks like a real bug, the enum which has a typedef `hsa_agent_info_t` has a max enumerator with a value of `24` and therefore because it does not have a fixed underlying type the value range is indeed `[0, 31]`.

I am not sure what the right fix is here since it looks like the enum is meant to be used with C as well as C++. In C++ one could give a fixed underlying type if it was meant to have any `int` value let's say.

`HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT` is way outside the values of `hsa_agent_info_t` so maybe this was not intended at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131307/new/

https://reviews.llvm.org/D131307



More information about the cfe-commits mailing list