stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r677791 - /stdcxx/branches/4.2.x/tests/include/rw_streambuf.h
Date Fri, 18 Jul 2008 00:28:17 GMT
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  <sebor@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



Mime
View raw message