float init 0 request

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Aug 18 19:55:29 UTC 2026


On 18/08/2026 7:16 PM, pete wrote:
> I agree this looks a bit inelegant in this example. For more complex 
> code I wouldn't mind at all manually setting f to nan if the compiler 
> could not determine whether all flow paths resulted in f being set. In 
> this case I would expect a code reviewer to also have an issue with it 
> and manually setting it to nan would highlight that there could be a 
> problem.
> 
> I wouldn't really mind the nan default as long as there was a way of 
> opting out. I would rather the compiler not use poison values if it can 
> just easily ask me how to fix it during the compilation phase. Some 
> people like poison values. Maybe for them the debugging for nan is 
> trivial and that is fine. For some applications it is a pain and the 
> main problem is that sometimes it doesn't even show up until much later.

I'm ok with this, however this is going to be a pretty invasive change 
and its stops being simply a static analysis feature of the compiler.

Its a good example of why I'm not writing out the exact behavior of the 
fastdfa engine, I want people to interpret the results of their 
experience and judge when they think it should or shouldn't be 
activating, because it is dependent on the user base on how it should be 
configured.

For these kinds of problems its a sociological problem to what extent 
people are willing put up with false positives.



More information about the Digitalmars-d mailing list