[uuid] Unused variable warnings

Hi, With recent versions of boost I get lots of warnings like the following: /.../boost/uuid/seed_rng.hpp: In member function ‘void boost::uuids::detail::seed_rng::sha1_random_digest_()’: /.../boost/uuid/seed_rng.hpp:157:24: warning: variable ‘not_used’ set but not used [-Wunused-but-set-variable] I'm using GCC 4.6 with -Wall. It's trivial to mask this warning out by attaching __attribute__((unused)) to the variable, which I've done locally. Ok to commit?

Hi, On Fri, Apr 27, 2012, at 01:41 PM, Andrey Semashev wrote:
Hi,
With recent versions of boost I get lots of warnings like the following:
/.../boost/uuid/seed_rng.hpp: In member function ‘void boost::uuids::detail::seed_rng::sha1_random_digest_()’: /.../boost/uuid/seed_rng.hpp:157:24: warning: variable ‘not_used’ set but not used [-Wunused-but-set-variable]
I'm using GCC 4.6 with -Wall. It's trivial to mask this warning out by attaching __attribute__((unused)) to the variable, which I've done locally. Ok to commit?
This is great. There is a ticket already about this. https://svn.boost.org/trac/boost/ticket/6118. I don't have access to GCC 4.6, nor am I familiar with it and have not been able to solve this. Would you create a patch? I wish to review it before saying "ok to commit". Regards, Andy Tompkins

On Wednesday 02 May 2012 12:56:12 Andy Tompkins wrote:
Hi,
On Fri, Apr 27, 2012, at 01:41 PM, Andrey Semashev wrote:
Hi,
With recent versions of boost I get lots of warnings like the following:
/.../boost/uuid/seed_rng.hpp: In member function ‘void boost::uuids::detail::seed_rng::sha1_random_digest_()’: /.../boost/uuid/seed_rng.hpp:157:24: warning: variable ‘not_used’ set but not used [-Wunused-but-set-variable]
I'm using GCC 4.6 with -Wall. It's trivial to mask this warning out by attaching __attribute__((unused)) to the variable, which I've done locally. Ok to commit?
This is great.
There is a ticket already about this. https://svn.boost.org/trac/boost/ticket/6118. I don't have access to GCC 4.6, nor am I familiar with it and have not been able to solve this.
Would you create a patch? I wish to review it before saying "ok to commit".
Sorry, I couldn't wait and committed it already. You can see the change in trunk and release branch. Feel free to modify it as you see fit.
participants (2)
-
Andrey Semashev
-
Andy Tompkins