Remix.run Logo
bluGill 7 months ago

> UB in uninitialized variables

You will be happy to learn the uninitialized variables are not UB as of C++26.

quotemstr 7 months ago | parent [-]

They're just initialized to some unspecified value and cause almost-as-hard-to-diagnose faults.

bluGill 7 months ago | parent [-]

the unspecified value is supposed to be something really obviously wrong (in particular sanitizers will look for it.) and so be easier to diagnose with tools. Unlike 0 which is really hard to diagnose because often it is the right value and so when it isn't you won't realize what you did wrong.