[PATCH] D146194: NOT report the warning that unnamed bitfields are uninitialized.

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 03:03:42 PDT 2023


steakhal requested changes to this revision.
steakhal added a comment.
This revision now requires changes to proceed.

Thanks for looking into this.

I could not reproduce the issue with the following test code:  https://godbolt.org/z/hsY9PTKGz

  struct A {
    unsigned x : 3;
    unsigned : 29; 
    unsigned y;
  };
  void func1(A a);
  
  void func2() {
    A a = {0};
    func1(a); // no-warning here on trunk
  }

I'd recommend adding a test that would demonstrate that before your fix the test would diagnose a FP and after your fix, the FP would disappear.
Without tests, unfortunately, we cannot accept patches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146194



More information about the cfe-commits mailing list