[PATCH] D157879: [clang] Report missing designated initializers in C++

Ian McKellar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 12:20:26 PDT 2023


ianloic added a comment.

In D157879#4604233 <https://reviews.llvm.org/D157879#4604233>, @aeubanks wrote:

> ah I thought this was in `-Wall` but it's not
>
> the struct is
>
>   struct Foo {
>     const void* buffer;
>     uint32_t capacity;
>     uint32_t reserved;
>   };
>
> where `reserved` isn't explicitly initialized. that seems like reasonable code, but I suppose we can just explicitly initialize `reserved` here

FWIW, if this is the specific piece of code that led me to this conversation, that declaration is in a header which at least in theory is supposed to remain compatible with C. It's inside `extern "C" { ... }` even. We can't add explicit initialize `reserved` and keep the definition C comaptible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157879



More information about the cfe-commits mailing list