[clang] Revert "[clang][CodeGen] Zero init unspecified fields in initializers in C" (PR #109898)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 21:10:27 PDT 2024


yabinc wrote:

LGTM

One problem I found is for bitfields:
struct { 
  char x;
  unsigned char y : 4;
  unsigned char z : 7;
} __attribute__((packed)) t5  = { 101,  15, 123 };

The last field takes byte 2-3, while the code thinks it only takes byte 2. The code didn't consider well for fields starting from (or ending with) a (% 8 != 0) bit offset.

https://github.com/llvm/llvm-project/pull/109898


More information about the cfe-commits mailing list