Add -wnan switch to flag default NaN initializations

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri Aug 21 08:20:05 UTC 2026


On 21/08/2026 8:06 PM, Alexandru Ermicioi wrote:
> On Friday, 21 August 2026 at 08:03:46 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> They don't serve the same purpose, although they may appear the same 
>> on the surface.
>>
>> Also nobody has asked for the ability to audit the locations where 
>> this exists, like they did for TLS.
> 
> Still a bit better, than nothing right?

Not exactly: 
https://dlang.org/changelog/2.113.0.html#dmd.fastdfa.uninitialized

The switch could be useful in tracking down default init, but it won't 
help you if you write float.nan some place, or is in library code that 
the compiler isn't seeing.

Each of these solutions has their own tradeoffs, and neither is perfect.

Its a good feature, but what I have classified as a low value one.



More information about the Digitalmars-d mailing list