Fix more problems found by GCC 4.6.0's static checks.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Mar 2011 00:39:12 +0000 (17:39 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Mar 2011 00:39:12 +0000 (17:39 -0700)
lib-src/ChangeLog
src/ChangeLog
src/eval.c

index 1c0c506..5007995 100644 (file)
@@ -1,5 +1,6 @@
-2011-03-29  Paul Eggert  <eggert@cs.ucla.edu>
+2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Fix a problem found by GCC 4.6.0's static checks.
        * etags.c (just_read_file): Remove dummy variable and simplify.
 
 2011-03-27  Glenn Morris  <rgm@gnu.org>
index c44444a..973b771 100644 (file)
@@ -1,12 +1,12 @@
 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Fix more problems found by GCC 4.6.0's static checks.
+
        * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
        Remove unused local var.
 
        * editfns.c (Fmessage_box): Remove unused local var.
 
-2011-03-29  Paul Eggert  <eggert@cs.ucla.edu>
-
        * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
        (note_mode_line_or_margin_highlight, note_mouse_highlight):
        Omit unused local vars.
@@ -55,7 +55,7 @@
        caused (substring ...) to crash on large vectors (Bug#8344).
        * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
        (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
-       All variadic functions changed accordingly.
+       All variadic functions and their callers changed accordingly.
        (struct gcpro.nvars): Now size_t, not int.  All uses changed.
        * data.c (arith_driver, float_arith_driver): Likewise.
        * editfns.c (general_insert_function): Likewise.
index c3f9cd1..26aea3d 100644 (file)
@@ -37,7 +37,7 @@ struct backtrace
 {
   struct backtrace *next;
   Lisp_Object *function;
-  Lisp_Object *args;   /* Points to vector of args. */
+  Lisp_Object *args;   /* Points to vector of args.  */
   size_t nargs;                /* Length of vector.
                           If nargs is (size_t) UNEVALLED, args points
                           to slot holding list of unevalled args.  */
@@ -2188,7 +2188,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
       CHECK_CONS_LIST ();
 
       if (XINT (numargs) < XSUBR (fun)->min_args
-         || (0 <= XSUBR (fun)->max_args
+         || (XSUBR (fun)->max_args >= 0
              && XSUBR (fun)->max_args < XINT (numargs)))
        xsignal2 (Qwrong_number_of_arguments, original_fun, numargs);