diff liboctave/Array-util.cc @ 10486:4e64fbbd5c58

allow non-integer values in ranges used for array indexing
author John W. Eaton <jwe@octave.org>
date Fri, 02 Apr 2010 14:28:34 -0400
parents 0677c5d80b77
children 942386d6d1a5
line wrap: on
line diff
--- a/liboctave/Array-util.cc
+++ b/liboctave/Array-util.cc
@@ -694,11 +694,16 @@
      is1d ? "I" : "..,I,..", idx, ext);
 }
 
-void gripe_invalid_index (void)
+void gripe_invalid_index (bool err)
 {
   const char *err_id = error_id_invalid_index;
-  (*current_liboctave_error_with_id_handler)
-    (err_id, "subscript indices must be either positive integers or logicals.");
+
+  if (err)
+    (*current_liboctave_error_with_id_handler)
+      (err_id, "subscript indices must be either positive integers or logicals");
+  else
+    (*current_liboctave_warning_with_id_handler)
+      (err_id, "non-integer subscripts in index expression");
 }
 
 // FIXME -- the following is a common error message to resize,