[mlpack-svn] r11148 - mlpack/trunk/src/mlpack/core/util

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jan 18 16:36:05 EST 2012


Author: jcline3
Date: 2012-01-18 16:36:05 -0500 (Wed, 18 Jan 2012)
New Revision: 11148

Modified:
   mlpack/trunk/src/mlpack/core/util/nulloutstream.hpp
Log:
Fix the compilation error from my -Wunused-parameter fix when compiling
without debugging and profiling and with -O2.


Modified: mlpack/trunk/src/mlpack/core/util/nulloutstream.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/nulloutstream.hpp	2012-01-18 21:21:07 UTC (rev 11147)
+++ mlpack/trunk/src/mlpack/core/util/nulloutstream.hpp	2012-01-18 21:36:05 UTC (rev 11148)
@@ -32,47 +32,54 @@
    */
   NullOutStream(const NullOutStream& /* other */) { }
 
+  /*
+   We use (void) paramName in order to avoid the warning generated by
+   -Wextra. For some currently unknown reason, simply deleting the 
+   parameter name (aka, outperator<<(bool) {...}) causes a compilation
+   error (with -Werror off) for only this class.
+   */
+
   //! Does nothing.
-  NullOutStream& operator<<(bool /* val */) { return *this; }
+  NullOutStream& operator<<(bool val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(short /* val */) { return *this; }
+  NullOutStream& operator<<(short val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(unsigned short /* val */) { return *this; }
+  NullOutStream& operator<<(unsigned short val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(int /* val */) { return *this; }
+  NullOutStream& operator<<(int val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(unsigned int /* val */) { return *this; }
+  NullOutStream& operator<<(unsigned int val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(long /* val */) { return *this; }
+  NullOutStream& operator<<(long val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(unsigned long /* val */) { return *this; }
+  NullOutStream& operator<<(unsigned long val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(float /* val */) { return *this; }
+  NullOutStream& operator<<(float val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(double /* val */) { return *this; }
+  NullOutStream& operator<<(double val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(long double /* val */) { return *this; }
+  NullOutStream& operator<<(long double val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(void* /* val */) { return *this; }
+  NullOutStream& operator<<(void* val) { (void) val; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(const char* /* str */) { return *this; }
+  NullOutStream& operator<<(const char* str) { (void) str; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(std::string& /* str */) { return *this; }
+  NullOutStream& operator<<(std::string& str) { (void) str; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(std::streambuf* /* sb */) { return *this; }
+  NullOutStream& operator<<(std::streambuf* sb) { (void) sb; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(std::ostream& /* (*pf) (std::ostream&) */)
-  { return *this; }
+  NullOutStream& operator<<(std::ostream& (*pf) (std::ostream&))
+  { (void) pf; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(std::ios& /* (*pf) (std::ios&) */) { return *this; }
+  NullOutStream& operator<<(std::ios& (*pf) (std::ios&)) { (void) pf; return *this; }
   //! Does nothing.
-  NullOutStream& operator<<(std::ios_base& /* (*pf) (std::ios_base&) */)
-  { return *this; }
+  NullOutStream& operator<<(std::ios_base& (*pf) (std::ios_base&))
+  { (void) pf; return *this; }
 
   //! Does nothing.
   template<typename T>
-  NullOutStream& operator<<(T /* s */)
-  { return *this; }
+  NullOutStream& operator<<(T s)
+  { (void) s; return *this; }
 };
 
 } // namespace io




More information about the mlpack-svn mailing list