stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r651086 - /stdcxx/branches/4.2.x/tests/src/value.cpp
Date Wed, 23 Apr 2008 21:58:34 GMT
Author: sebor
Date: Wed Apr 23 14:58:33 2008
New Revision: 651086

URL: http://svn.apache.org/viewvc?rev=651086&view=rev
Log:
2008-04-23  Martin Sebor  <sebor@roguewave.com>

	STDCXX-757
	* tests/src/value.cpp (UserClass::assign): Added a (redundant) default
	label to switch statement to shut up bogus HP aCC warning #20200-D:
	Potential null pointer dereference.
	(__rw_from_char): Asserted a trivially true precondition to silence
	the same warning.
	(_rw_fmtxarrayv): Removed an unused local variable.

Modified:
    stdcxx/branches/4.2.x/tests/src/value.cpp

Modified: stdcxx/branches/4.2.x/tests/src/value.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/value.cpp?rev=651086&r1=651085&r2=651086&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/src/value.cpp (original)
+++ stdcxx/branches/4.2.x/tests/src/value.cpp Wed Apr 23 14:58:33 2008
@@ -244,6 +244,12 @@
         pex        = &ex_div_assign;
         new_val    = data_.val_ / rhs.data_.val_;
         break;
+
+    default:
+        // should never get here (silences bogus HP aCC/cadvise
+        // warning #20200-D: Potential null pointer dereference)
+        RW_ASSERT (!"unhandled case");
+        return;
     }
 
     // increment the number of invocations of the operator
@@ -494,6 +500,11 @@
 
     typedef unsigned char UChar;
 
+    // this should trivially hold given the above but the assert
+    // silences bogus HP aCC/cadvise warning #20200-D: Potential
+    // null pointer dereference
+    RW_ASSERT (0 != array);
+
     for (size_t i = 0; i < strlen_; ++i)
         array [i].data_.val_ = UChar (str_ [i]);
 
@@ -680,7 +691,6 @@
     bool     fl_plus  =  false;
     bool     fl_pound =  false;
     int      nelems   = -1;
-    int      paramno  = -1;
     int      cursor   = -1;
 
     const UserClass* pelem    = 0;
@@ -731,9 +741,7 @@
         // process positional parameter or width
         char* end = 0;
         const int arg = strtol (fmt, &end, 10);
-        if ('$' == *end)
-            paramno = arg;
-        else
+        if ('$' != *end)
             nelems = arg;
 
         fmt = end;



Mime
View raw message