Is there a command line option to initialize reals to NaN?

Is there a command line option to initialize reals to NaN?

I was wondering whether ifort has support (or plans thereof) for an option to initialize reals to NaN (in debug build or otherwise)? We have encountered several time consuming bugs where this might have helped.

I thought to ask this question as some time I read that the D programming language takes this approach to make errors with uninitialized reals more apparent, see e.g.

3 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Did you consider the recommendations in Dave Barker's presentation?

We don't have current plans to do this, though various improvements to uninitialized variable detection continue to be discussed. With respect to NaN initialization, that is not as helpful as you might think since NaNs are allowed to participate in arithmetic operations. Another issue is that the processor automatically converts signaling NaNs to "quiet NaNs" upon a load into a register. Also, this does you no good for datatypes other than real/complex. It's one of those ideas that seems great at first, but then when you start poking and prodding the luster wears off.

We do currently offer a limited form of run-time uninitialized variable checking, though it is probably too limited to be useful. Users with a license for Fortran Studio XE or Parallel Studio XE (or Cluster Studio XE) can use the Static Analysis feature that does whole-program correctness checking, including uninitialized variable detection.  It too isn't perfect but it can be very helpful.

Steve - Intel Developer Support

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi