Re: RFC: C++ and C23 zero initialization of padding bits

2024-10-07 Thread Joseph Myers
On Sat, 28 Sep 2024, Jakub Jelinek wrote: > I'd hope that structure assignment is element-wise copying and so doesn't > need to preserve those bits. What about memcpy, or *(unsigned char *), > or for C++ std::bit_cast inspection of the bits (constexpr for C++ or not)? In C, memcpy or *(unsigned

Re: RFC: C++ and C23 zero initialization of padding bits

2024-09-28 Thread Richard Biener
On Sat, 28 Sep 2024, Jakub Jelinek wrote: > Hi! > > C++ has > https://eel.is/c++draft/dcl.init#general-6.2 > https://eel.is/c++draft/dcl.init#general-6.3 > which says that during zero-initialization padding bits of structures > and unions are zero initialized, and in > https://eel.is/c++draft/dcl

RFC: C++ and C23 zero initialization of padding bits

2024-09-28 Thread Jakub Jelinek
Hi! C++ has https://eel.is/c++draft/dcl.init#general-6.2 https://eel.is/c++draft/dcl.init#general-6.3 which says that during zero-initialization padding bits of structures and unions are zero initialized, and in https://eel.is/c++draft/dcl.init#general-9.3 says that in certain cases value-initiali