goto skipping declarations

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Sep 22 21:12:55 UTC 2025


On 23/09/2025 5:31 AM, Walter Bright wrote:
> On 9/18/2025 7:03 PM, Steven Schveighoffer wrote:
>> So the skipping of initialization is technically caught, it's just 
>> that D default initializes and C does not.
> 
> In C, the function still returns an uninitialized value.
> 
> Some people on X told me that throwing more compiler switches, and/or 
> running various linters and code analyzers, would detect the problem.
> 
> That's true, but the *language* as specified does not detect these 
> problems.

Indeed, this specific analysis is very common, and given the recent work 
to solve UB in C2Y, I'm surprised it hasn't come up yet.

Although they at least have one example of this: 
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3453.pdf


More information about the Digitalmars-d mailing list