changeset 10987:eec74ee00b32

eliminate some GCC warnings
author John W. Eaton <jwe@octave.org>
date Thu, 16 Sep 2010 07:08:02 -0400
parents 20bb05b9fb3f
children f1c4527b4024
files src/ChangeLog src/DLD-FUNCTIONS/svd.cc src/pr-output.cc src/utils.cc
diffstat 4 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Sep 16 06:30:15 2010 -0400
+++ b/src/ChangeLog	Thu Sep 16 07:08:02 2010 -0400
@@ -1,3 +1,15 @@
+2010-09-16  John W. Eaton  <jwe@octave.org>
+
+	* DLD-FUNCTIONS/svd.cc (Fsvd): Delete assert to avoid
+	"comparison is always false due to limited range of data type"
+	warning from GCC.
+
+	* utils.cc (octave_vsnprintf): Declare nchars volatile to avoid
+	GCC warning.
+
+	* pr-output.cc (octave_print_internal): Avoid uninitialized
+	variable warning from GCC.
+
 2010-09-16  John Swensen  <jpswensen@gmail.com>
 
 	* DLD-FUNCTIONS/__magick_read__.cc (write_images): Allow
--- a/src/DLD-FUNCTIONS/svd.cc	Thu Sep 16 06:30:15 2010 -0400
+++ b/src/DLD-FUNCTIONS/svd.cc	Thu Sep 16 07:08:02 2010 -0400
@@ -152,7 +152,6 @@
                     : (nargin == 2) ? SVD::economy : SVD::std);
 
   SVD::driver driver = static_cast<SVD::driver> (Vsvd_driver);
-  assert (driver == SVD::GESVD || driver == SVD::GESDD);
 
   if (nr == 0 || nc == 0)
     {
--- a/src/pr-output.cc	Thu Sep 16 06:30:15 2010 -0400
+++ b/src/pr-output.cc	Thu Sep 16 07:08:02 2010 -0400
@@ -2648,7 +2648,7 @@
     }
   else
     {
-      int fw;
+      int fw = 0;
       double scale = 1.0;
       set_format (r, fw, scale);
 
--- a/src/utils.cc	Thu Sep 16 06:30:15 2010 -0400
+++ b/src/utils.cc	Thu Sep 16 07:08:02 2010 -0400
@@ -1213,7 +1213,7 @@
 
   static char *buf = 0;
 
-  int nchars = 0;
+  volatile int nchars = 0;
 
   if (! buf)
     buf = new char [size];