zhaopuming / quickfast

Automatically exported from code.google.com/p/quickfast
Other
1 stars 0 forks source link

sequence point warning in DataSource.h #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
gcc 4.7 was throwing a sequence point warning for one line in DataSource.h.  I 
guess it's confused about whether position_ should be incremented before or 
after the comparison.  Here's the patch to make it increment after:

diff --git a/src/external/quickfast/Codecs/DataSource.h 
b/src/external/quickfast/Codecs/DataSource.h
index 715bf64..e1ffb40 100644
--- a/src/external/quickfast/Codecs/DataSource.h
+++ b/src/external/quickfast/Codecs/DataSource.h
@@ -88,7 +88,8 @@ namespace QuickFAST{
           size_t end = position_ + used;
           while (position_ < end)
           {
-            doEcho(position_ < size_, buffer_[position_++]);
+            doEcho(position_ < size_, buffer_[position_]);
+            position_++;
           }
         }
         else

Original issue reported on code.google.com by y...@fractal-llc.com on 16 Jun 2012 at 2:35

GoogleCodeExporter commented 9 years ago
Thanks for the problem report and the patch.  I'll incorporate it.

Original comment by dale.wil...@gmail.com on 3 Jul 2012 at 6:11