You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2008/07/18 02:28:17 UTC

svn commit: r677791 - /stdcxx/branches/4.2.x/tests/include/rw_streambuf.h

Author: sebor
Date: Thu Jul 17 17:28:17 2008
New Revision: 677791

URL: http://svn.apache.org/viewvc?rev=677791&view=rev
Log:
2008-07-17  Martin Sebor  <se...@roguewave.com>

	STDCXX-780
	* tests/include/rw_streambuf.h (test): Aasserted a precondition
	to silence HP aCC 6/cadvise warning #20206-D: Out of bound access.

Modified:
    stdcxx/branches/4.2.x/tests/include/rw_streambuf.h

Modified: stdcxx/branches/4.2.x/tests/include/rw_streambuf.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/include/rw_streambuf.h?rev=677791&r1=677790&r2=677791&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/include/rw_streambuf.h (original)
+++ stdcxx/branches/4.2.x/tests/include/rw_streambuf.h Thu Jul 17 17:28:17 2008
@@ -461,10 +461,14 @@
 {
     MyStreambuf* const self = _RWSTD_CONST_CAST (MyStreambuf*, this);
 
-    int inx = memfun_inx (which);
-    if (-1 == inx)
+    const int inx = memfun_inx (which);
+    if (inx < 0)
         return true;
 
+    // assert precondition to silence HP aCC 6/cadvise warning
+    // #20206-D: Out of bound access 
+    RW_ASSERT ((_RWSTD_SIZE_T)inx < sizeof ncalls_ / sizeof *ncalls_);
+
     // increment the counter tracking the number of calls made
     // to each member function; do so regardless of whether
     // an exception will be thrown below