Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78238 - branches/release/boost/uuid
From: andrey.semashev_at_[hidden]
Date: 2012-04-28 07:25:49


Author: andysem
Date: 2012-04-28 07:25:48 EDT (Sat, 28 Apr 2012)
New Revision: 78238
URL: http://svn.boost.org/trac/boost/changeset/78238

Log:
Silenced GCC warnings about an initialized but not used variable.
Text files modified:
   branches/release/boost/uuid/seed_rng.hpp | 11 +++++++----
   1 files changed, 7 insertions(+), 4 deletions(-)

Modified: branches/release/boost/uuid/seed_rng.hpp
==============================================================================
--- branches/release/boost/uuid/seed_rng.hpp (original)
+++ branches/release/boost/uuid/seed_rng.hpp 2012-04-28 07:25:48 EDT (Sat, 28 Apr 2012)
@@ -79,7 +79,7 @@
         : rd_index_(5)
         , random_(std::fopen( "/dev/urandom", "rb" ))
     {}
-
+
     ~seed_rng()
     {
         if (random_) {
@@ -139,7 +139,7 @@
         }
 
         {
- unsigned int rn[] =
+ unsigned int rn[] =
                 { static_cast<unsigned int>(std::rand())
                 , static_cast<unsigned int>(std::rand())
                 , static_cast<unsigned int>(std::rand())
@@ -154,6 +154,9 @@
             if(random_)
             {
                 // the not_used variable is to suppress warnings
+#if defined(__GNUC__)
+ __attribute__((unused))
+#endif
                 size_t not_used = 0;
                 not_used = std::fread( buffer, 1, 20, random_ );
             }
@@ -190,7 +193,7 @@
     unsigned int rd_[5];
     int rd_index_;
     std::FILE * random_;
-
+
 private: // make seed_rng noncopyable
     seed_rng(seed_rng const&);
     seed_rng& operator=(seed_rng const&);
@@ -213,7 +216,7 @@
       , single_pass_traversal_tag
       , typename Generator::result_type const&
> super_t;
-
+
  public:
     generator_iterator() : m_g(NULL) {}
     generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk