Boost logo

Ublas :

Subject: [ublas] [patch proposal] Suppress 'unused variable' warnings in functional.hpp
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-06-25 03:43:26


Hi,

I've created a patch for suppressing the annoying compiler warnings
about "unused variables" in functional.hpp.

The patch is composed by
* a new file that I've called
    boost/numeric/ublas/detail/compiler.hpp
  where I've defined the macro
    BOOST_UBLAS_SUPPRESS_UNUSED_VARIABLE_WARNING

* and by a "patch file" to apply to functional.hpp where the above
macro is used.

For instance, a possible use of the macro is in:
--- [code] ---
         static
         BOOST_UBLAS_INLINE
         size_type global_mutable_restrict2 (size_type index1,
size_type size1, size_type index2, size_type size2) {
           BOOST_UBLAS_SUPPRESS_UNUSED_VARIABLE_WARNING( index1 );
           BOOST_UBLAS_SUPPRESS_UNUSED_VARIABLE_WARNING( size1 );

             return (std::max)(size_type(0), (std::min)(size2, index2) );
         }
--- [/code] ---

If you find it useful, I can create a TRAC ticket and submit the patch.

PS: I didn't find a similar macro in Boost. If there exists, please let me know.

Best,

-- Marco