[PATCH] D133574: [C2x] reject type definitions in offsetof

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 13:27:19 PDT 2022


nickdesaulniers added a comment.

In D133574#3816066 <https://reviews.llvm.org/D133574#3816066>, @nathanchance wrote:

> In D133574#3815951 <https://reviews.llvm.org/D133574#3815951>, @aaron.ballman wrote:
>
>> LGTM, thank you! Please don't land until you have some indication from the kernel folks that this won't be super disruptive for them. CC @nickdesaulniers and @nathanchance for awareness.
>
> Thank you a lot for the heads up! I see an in-flight change around this from YingChi on the mailing list:
>
> https://lore.kernel.org/20220925153151.2467884-1-me@inclyc.cn/
>
> It would be good to have that change accepted into a maintainer's tree and on its way to mainline (Linus's tree) and by extension, the stable releases before merging this into main, as we and several other groups are actively testing all Linux branches with LLVM main to catch other regressions and this error would require patching of our CI, which we can definitely do but prefer to avoid because of the maintenance overhead (we try to carry zero patches at all times).
>
> I am still running my set of builds against the kernel with this LLVM change and the aforementioned Linux change but I do see another error:
>
>   drivers/media/platform/nvidia/tegra-vde/v4l2.c:816:49: error: '' cannot be defined in 'offsetof'

^ perhaps we can say something about an anonymous struct rather than print an empty name?

Thanks for the consideration and the kernel patch. Patching the kernel and clang is exceptional, going "above and beyond."  Unless we are in a rush to land this, having a little more time for feedback from the kernel thread linked above I think would be good.

In particular, I was surprised by the distinction between `__alignof__` and `_Alignof` semantically.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133574



More information about the cfe-commits mailing list