Re: C aggregate passing (Rust kernel policy)

H. Peter Anvin
2025-02-27T15:28:17Z

On February 27, 2025 6:21:24 AM PST, Ventura Jack <venturajack85@gmail.com> wrote:
>On Wed, Feb 26, 2025 at 1:00 PM Martin Uecker <uecker@tugraz.at> wrote:
>>
>> I think C++ messed up a lot (including time-travel UB, uninitialized
>> variables, aliasing ules and much more), but I do not see
>> the problem here.
>
>C++26 actually changes the rules of reading uninitialized
>variables from being undefined behavior to being
>"erroneous behavior", for the purpose of decreasing instances
>that can cause UB. Though programmers can still opt-into
>the old behavior with UB, on a case by case basis, for the
>sake of performance.
>
>Best, VJ.
>
>

Of course, that is effectively what one gets if one treats the compiler warning as binding.