Boost logo

Boost Users :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-07-24 21:42:48


"drkm" <darkman_spam_at_[hidden]> wrote in message
news:wku0vz3zc1.fsf_at_yahoo.fr...
"Christopher Baus" <christopher_at_[hidden]> writes:

>>> Unless I'm missing something, this should do the trick:

>>> g++ -c -O2 -Wall -Wno-unused-variable foo.cpp

> Ok, I found the solution. I was looking for a pragma to do it, but
> the solution for gcc is the use the unused attribute.

  I think an idiomatic solution is :

    int unused ;
    unused ;

Rene Rivera proposed this:

  namespace boost { namespace detail {
      inline void no_unused_variable_warning(void*) { }
  } }

  #define BOOST_NO_UNUSED_VARIABLE_WARNING(v) \
      ::boost::detail::no_unused_variable_warning(&(v))

See
namespace boost { namespace detail {
    inline void no_unused_variable_warning(void*) { }
} }

http://lists.boost.org/MailArchives/boost/msg54904.phpJonathan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net