octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65321] C++20 warnings about deprecated uses o


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65321] C++20 warnings about deprecated uses of volatile variables
Date: Sat, 17 Feb 2024 13:11:54 -0500 (EST)

Follow-up Comment #5, bug#65321 (group octave):

I removed some more volatile tags in this changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/ebc26cef3096

Almost all of the remaining uses of volatile are in statements like


volatile double rcond_plus_one = rcond + 1.0;


The idea here is to prevent the use of extended precision that might make
rcond+1.0 different from 1.0 if rcond is small, or to prevent the compiler for
optimizing away a subsequent comparison between rcond+1.0 and 1.0.  We've been
using this method forever but is there a better way?

There are two other uses of volatile in lo-mappers.h that are different but
appear to have a similar purpose:


          T n = std::floor (q);

          // Prevent use of extra precision.
          volatile T tmp = y * n;

          retval = x - tmp;


Is volatile the best we can do for this purpose?



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65321>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]