lmi
[Top][All Lists]
Advanced

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

[lmi] [PATCH] Fix trivial warning in math functors test


From: Vadim Zeitlin
Subject: [lmi] [PATCH] Fix trivial warning in math functors test
Date: Sat, 28 Feb 2015 16:34:51 +0100

 Building the test suite with gcc 4.7.2 fails because of the combination of
the following warnings and -Werror used for compiling the tests:

        math_functors_test.cpp: In function 'void mete0()':
        math_functors_test.cpp:188:21: error: variable 'x' set but not used 
[-Werror=unused-but-set-variable]
        math_functors_test.cpp: In function 'void mete1()':
        math_functors_test.cpp:198:21: error: variable 'x' set but not used 
[-Werror=unused-but-set-variable]
        cc1plus: all warnings being treated as errors
        make[1]: *** [math_functors_test-math_functors_test.o] Error 1

 The following patch is probably the most trivial way of suppressing them:
---------------------------------- >8 --------------------------------------
diff --git a/math_functors_test.cpp b/math_functors_test.cpp
index b94fa8f..94962a7 100644
--- a/math_functors_test.cpp
+++ b/math_functors_test.cpp
@@ -190,6 +190,7 @@ void mete0()
     x = i_from_i_upper_12_over_12_naive<double>()(0.04);
     x = d_upper_12_from_i_naive        <double>()(0.04);
     x = net_i_from_gross_naive<double,365>()(0.04, 0.007, 0.003);
+    (void)x;
 }

 // This implementation uses production functors.
@@ -200,6 +201,7 @@ void mete1()
     x = i_from_i_upper_12_over_12<double>()(0.04);
     x = d_upper_12_from_i        <double>()(0.04);
     x = net_i_from_gross<double,365>()(0.04, 0.007, 0.003);
+    (void)x;
 }

 void assay_speed()
---------------------------------- >8 --------------------------------------

 Could you please apply it?

 Thanks in advance,
VZ

reply via email to

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