lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 65f5490 3/5: Don't use compound assignment wi


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 65f5490 3/5: Don't use compound assignment with volatile variables
Date: Thu, 14 May 2020 17:33:11 -0400 (EDT)

branch: master
commit 65f5490e8031787d75f6610e92993fc22b59307e
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Don't use compound assignment with volatile variables
    
    This results in errors with the tag -Werror=volatile with gcc 10:
    
    compound assignment with ‘volatile’-qualified left operand is deprecated
---
 sigfpe.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sigfpe.cpp b/sigfpe.cpp
index 6c5e5c3..224ca75 100644
--- a/sigfpe.cpp
+++ b/sigfpe.cpp
@@ -75,14 +75,14 @@ void fpe_handler_test()
 
 // FPU arithmetic overflow. TODO ?? Is this right, and does it work?
     d2 = dm;
-    d2 *= dm;
+    d2 = d2 * dm;
 
 // FPU arithmetic underflow. TODO ?? Isn't this overflow? Does this work?
     d2 = (d1 / dm) / dm;
 
 // FPU precision loss. TODO ?? Is this right, and does it work?
     d2 = d1 / dm;
-    d2 /= dm;
+    d2 = d2 / dm;
 
 // SIGFPE explicitly raised.
     std::raise(SIGFPE);



reply via email to

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