changeset 5016:2ade80e8c640

enable more warnings and fix them -------------------- ChangeLog entries follow: -------------------- ChangeLog addition: 2010-02-08 Ben Wing <ben@xemacs.org> * configure: * configure.ac (TAB): Various warnings that used to be present had mistakenly gotten turned off. Turn them back on. lwlib/ChangeLog addition: 2010-02-08 Ben Wing <ben@xemacs.org> * xt-wrappers.h: * xt-wrappers.h (Xt_SET_VALUE): * xt-wrappers.h (Xt_GET_VALUE): Rename var to avoid shadowing problems. src/ChangeLog addition: 2010-02-08 Ben Wing <ben@xemacs.org> * alloc.c: Add prototypes for debugging functions. * alloc.c (compact_string_chars): Make static. * console-x.c (x_initially_selected_for_input): * console-x.h: * console-x.h (X_ERROR_OCCURRED): Delete x_has_keysym() prototype from console-x.c, move to console-x.h. * eval.c (multiple_value_call): Real bug: Fix shadowing local vars. * event-unixoid.c (read_event_from_tty_or_stream_desc): * event-unixoid.c (signal_fake_event): * lread.c (check_if_suppressed): * strftime.c (strftime): Fix stupid global shadowing warnings. * event-unixoid.c (signal_fake_event): * event-unixoid.c (drain_signal_event_pipe): Use Rawbyte, not char. * frame.h: Remove old prototype. * gc.c: * gc.c (show_gc_cursor_and_message): * gc.c (remove_gc_cursor_and_message): * gc.c (gc_prepare): * gc.c (gc_finish_mark): * gc.c (gc_finalize): * gc.c (gc_sweep): * gc.c (gc_finish): * gc.c (gc_suspend_mark_phase): * gc.c (gc_resume_mark_phase): * gc.c (gc_mark): * gc.c (gc_resume_mark): Make fns static. * glyphs-eimage.c (gif_decode_error_string): Fix non-prototype. * lisp.h: Hack around global shadowing warnings involving `index'. * intl-win32.c (wcsncpy): * number-gmp.c (bigfloat_to_string): * objects-msw.c (mswindows_font_spec_matches_charset_stage_2): * specifier.c (call_charset_predicate): * specifier.c (DEFINE_SPECIFIER_TAG_FROB): Declarations cannot follow statements in standard C. * search.c (search_buffer): Fix local shadowing warnings.
author Ben Wing <ben@xemacs.org>
date Mon, 08 Feb 2010 21:28:57 -0600
parents d95c102a96d3
children d6368048cd8c
files ChangeLog configure configure.ac lwlib/ChangeLog lwlib/xt-wrappers.h src/ChangeLog src/alloc.c src/console-x.c src/console-x.h src/eval.c src/event-unixoid.c src/frame.h src/gc.c src/glyphs-eimage.c src/intl-win32.c src/lisp.h src/lread.c src/number-gmp.c src/objects-msw.c src/search.c src/specifier.c src/strftime.c
diffstat 22 files changed, 208 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 08 16:51:25 2010 -0600
+++ b/ChangeLog	Mon Feb 08 21:28:57 2010 -0600
@@ -1,3 +1,10 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	Various warnings that used to be present had mistakenly gotten
+	turned off. Turn them back on.
+
 2010-02-06  Ben Wing  <ben@xemacs.org>
 
 	* configure:
--- a/configure	Mon Feb 08 16:51:25 2010 -0600
+++ b/configure	Mon Feb 08 21:28:57 2010 -0600
@@ -9646,18 +9646,24 @@
     test "$__GCC" -ge 3 && with_cflags_warning="$with_cflags_warning -Wpacked"
             test "$have_glibc" != "yes" && \
       with_cflags_warning="$with_cflags_warning -Wpointer-arith"
-                                        if test "$XEMACS_CC_GPP" = "yes"; then
-      xe_cflags_warning="$with_cflags_warning -Weffc++"
-    elif test "$__GCC" -ge 3; then
-      xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+                                                                with_cflags_warning_c="-Wshadow -Wmissing-declarations"
+    with_cflags_warning_c="$with_cflags_warning_c -Wmissing-prototypes -Wstrict-prototypes"
+    with_cflags_warning_cxx="-Weffc++"
+    with_cflags_warning_c_xe=""
+                                if test "$__GCC" -ge 3; then
+      with_cflags_warning_c_xe="$with_cflags_warning_c_xe -Wunused-parameter"
       if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
-        with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
+        with_cflags_warning_c="$with_cflags_warning_c -Wdeclaration-after-statement"
       fi
     fi
-    with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
-    with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
-          elif test "$__ICC" = "yes"; then
-    with_cflags_warning="-Wall -w1 -we147"
+                            if test "$XEMACS_CC_GPP" = "yes"; then
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_cxx"
+    else
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_c $with_cflags_warning_c_xe"
+    fi
+    with_cflags_warning="$with_cflags_warning $with_cflags_warning_c"
+  elif test "$__ICC" = "yes"; then
+        with_cflags_warning="-Wall -w1 -we147"
     fi
 fi
 test -z "$xe_cflags_warning" && xe_cflags_warning="$with_cflags_warning"
--- a/configure.ac	Mon Feb 08 16:51:25 2010 -0600
+++ b/configure.ac	Mon Feb 08 21:28:57 2010 -0600
@@ -2053,28 +2053,52 @@
     dnl Ulrich Drepper has rejected patches to fix the glibc header files.
     test "$have_glibc" != "yes" && \
       with_cflags_warning="$with_cflags_warning -Wpointer-arith"
+    dnl
     dnl Warning flags that may differ for gcc and g++ (xemacs_compiler)
+    dnl
     dnl With g++, -Wshadow produces five zillion utterly random warnings --
     dnl a local var named `buffer' conflicts with `struct buffer' for
     dnl example.  Even with gcc, -Wshadow is questionable because of its
     dnl complaints about parameters with the same names as global functions.
-    dnl There is no -Wmissing-declarations under g++.
+    dnl There is no -Wmissing-declarations, -Wmissing-prototypes, or
+    dnl -Wstrict-prototypes under g++.
     dnl But gcc warns about -Weffc++ in C compiles.
+    dnl
+    dnl with_cflags_warning_c is for C-only warnings.
+    dnl with_cflags_warning_cxx is for C++-only warnings.
+    dnl with_cflags_warning_c_xe is for C-only warnings and only when
+    dnl   compiling the source tree (i.e. when --xemacs-compiler is used).
+    with_cflags_warning_c="-Wshadow -Wmissing-declarations"
+    with_cflags_warning_c="$with_cflags_warning_c -Wmissing-prototypes -Wstrict-prototypes"
+    with_cflags_warning_cxx="-Weffc++"
+    with_cflags_warning_c_xe=""
+    dnl -Wunused-parameter only appeared in gcc 3.
+    dnl -Wdeclaration-after-statement only appeared in gcc 3.4, and is C-only.
+    dnl -Wunused-parameter is too annoying for use in lib-src, partly because
+    dnl the UNUSED() decl is in compiler.h and we don't include that in any
+    dnl of the lib-src files.
     dnl With g++, there is no effective way to use -Wunused-parameter without
     dnl some very ugly code changes.
-    if test "$XEMACS_CC_GPP" = "yes"; then
-      xe_cflags_warning="$with_cflags_warning -Weffc++"
-    elif test "$__GCC" -ge 3; then
-      xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+    if test "$__GCC" -ge 3; then
+      with_cflags_warning_c_xe="$with_cflags_warning_c_xe -Wunused-parameter"
       if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
-        with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
+        with_cflags_warning_c="$with_cflags_warning_c -Wdeclaration-after-statement"
       fi
     fi
-    with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
-    with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
-    dnl **** If more gcc/g++ flags are added, from here on must handle
-    dnl **** with_cflags_warning and xe_cflags_warning in parallel
+    dnl **** If more gcc/g++ flags are added, add them above, not below
+    dnl
+    dnl Now set warnings for the source tree (xe_cflags_warning) and for
+    dnl lib-src (with_cflags_warning).  Note that if we didn't set
+    dnl xe_cflags_warning, it would automatically be initialized from
+    dnl with_cflags_warning.
+    if test "$XEMACS_CC_GPP" = "yes"; then
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_cxx"
+    else
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_c $with_cflags_warning_c_xe"
+    fi
+    with_cflags_warning="$with_cflags_warning $with_cflags_warning_c"
   elif test "$__ICC" = "yes"; then
+    dnl This will apply to both source tree and lib-src
     with_cflags_warning="-Wall -w1 -we147"
   dnl ### Add optimal with_cflags_warning support for other compilers HERE!
   fi
--- a/lwlib/ChangeLog	Mon Feb 08 16:51:25 2010 -0600
+++ b/lwlib/ChangeLog	Mon Feb 08 21:28:57 2010 -0600
@@ -1,3 +1,10 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* xt-wrappers.h:
+	* xt-wrappers.h (Xt_SET_VALUE):
+	* xt-wrappers.h (Xt_GET_VALUE):
+	Rename var to avoid shadowing problems.
+
 2010-01-24  Ben Wing  <ben@xemacs.org>
 
 	* xlwgauge.c (GaugeResize):
--- a/lwlib/xt-wrappers.h	Mon Feb 08 16:51:25 2010 -0600
+++ b/lwlib/xt-wrappers.h	Mon Feb 08 21:28:57 2010 -0600
@@ -89,15 +89,15 @@
 /* Convenience macros for getting/setting one resource value. */
 
 #define Xt_SET_VALUE(widget, resource, value) do {	\
-  Arg al;						\
-  Xt_SET_ARG (al, resource, value);			\
-  XtSetValues (widget, &al, 1);				\
+  Arg al__;						\
+  Xt_SET_ARG (al__, resource, value);			\
+  XtSetValues (widget, &al__, 1);			\
 } while (0)
 
 #define Xt_GET_VALUE(widget, resource, location) do {	\
-  Arg al;						\
-  Xt_SET_ARG (al, resource, location);			\
-  XtGetValues (widget, &al, 1);				\
+  Arg al__;						\
+  Xt_SET_ARG (al__, resource, location);		\
+  XtGetValues (widget, &al__, 1);			\
 } while (0)
 
 #endif /* INCLUDED_xt_wrappers_h_ */
--- a/src/ChangeLog	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/ChangeLog	Mon Feb 08 21:28:57 2010 -0600
@@ -1,3 +1,59 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c:
+	Add prototypes for debugging functions.
+	
+	* alloc.c (compact_string_chars): Make static.
+	
+	* console-x.c (x_initially_selected_for_input):
+	* console-x.h:
+	* console-x.h (X_ERROR_OCCURRED):
+	Delete x_has_keysym() prototype from console-x.c, move to console-x.h.
+
+	* eval.c (multiple_value_call):
+	Real bug: Fix shadowing local vars.
+	
+	* event-unixoid.c (read_event_from_tty_or_stream_desc):
+	* event-unixoid.c (signal_fake_event):
+	* lread.c (check_if_suppressed):
+	* strftime.c (strftime):
+	Fix stupid global shadowing warnings.
+	
+	* event-unixoid.c (signal_fake_event):
+	* event-unixoid.c (drain_signal_event_pipe):
+	Use Rawbyte, not char.
+	
+	* frame.h: Remove old prototype.
+	
+	* gc.c:
+	* gc.c (show_gc_cursor_and_message):
+	* gc.c (remove_gc_cursor_and_message):
+	* gc.c (gc_prepare):
+	* gc.c (gc_finish_mark):
+	* gc.c (gc_finalize):
+	* gc.c (gc_sweep):
+	* gc.c (gc_finish):
+	* gc.c (gc_suspend_mark_phase):
+	* gc.c (gc_resume_mark_phase):
+	* gc.c (gc_mark):
+	* gc.c (gc_resume_mark):
+	Make fns static.
+	
+	* glyphs-eimage.c (gif_decode_error_string):
+	Fix non-prototype.
+	
+	* lisp.h:
+	Hack around global shadowing warnings involving `index'.
+	
+	* intl-win32.c (wcsncpy):
+	* number-gmp.c (bigfloat_to_string):
+	* objects-msw.c (mswindows_font_spec_matches_charset_stage_2):
+	* specifier.c (call_charset_predicate):
+	* specifier.c (DEFINE_SPECIFIER_TAG_FROB):
+	Declarations cannot follow statements in standard C.
+
+	* search.c (search_buffer): Fix local shadowing warnings.
+	
 2010-02-08  Ben Wing  <ben@xemacs.org>
 
 	* faces.c:
--- a/src/alloc.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/alloc.c	Mon Feb 08 21:28:57 2010 -0600
@@ -3304,6 +3304,8 @@
   dump_add_root_lisp_object (varaddress);
 }
 
+const Ascbyte *staticpro_name (int count);
+
 /* External debugging function: Return the name of the variable at offset
    COUNT. */
 const Ascbyte *
@@ -3324,6 +3326,8 @@
   Dynarr_add (staticpro_nodump_names, varname);
 }
 
+const Ascbyte *staticpro_nodump_name (int count);
+
 /* External debugging function: Return the name of the variable at offset
    COUNT. */
 const Ascbyte *
@@ -4136,7 +4140,7 @@
 #ifndef NEW_GC
 /* Compactify string chars, relocating the reference to each --
    free any empty string_chars_block we see. */
-void
+static void
 compact_string_chars (void)
 {
   struct string_chars_block *to_sb = first_string_chars_block;
--- a/src/console-x.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/console-x.c	Mon Feb 08 21:28:57 2010 -0600
@@ -43,8 +43,6 @@
 
 int wedge_metacity;	/* nonzero means update WM_HINTS always */
 
-extern void x_has_keysym (KeySym, Lisp_Object, int);
-
 static int
 x_initially_selected_for_input (struct console *UNUSED (con))
 {
--- a/src/console-x.h	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/console-x.h	Mon Feb 08 21:28:57 2010 -0600
@@ -145,6 +145,7 @@
 
 int x_initialize_frame_menubar (struct frame *f);
 void x_init_modifier_mapping (struct device *d);
+void x_has_keysym (KeySym, Lisp_Object, int);
 
 int x_frame_window_state (struct frame *f);
 
--- a/src/eval.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/eval.c	Mon Feb 08 21:28:57 2010 -0600
@@ -4723,11 +4723,11 @@
       if (MULTIPLE_VALUEP (result))
         {
           Lisp_Object val;
-          Elemcount i, count = XMULTIPLE_VALUE_COUNT (result);
-
-          for (i = 0; i < count; i++)
+          Elemcount j, count = XMULTIPLE_VALUE_COUNT (result);
+
+          for (j = 0; j < count; j++)
             {
-              val = multiple_value_aref (result, i);
+              val = multiple_value_aref (result, j);
               assert (!UNBOUNDP (val));
 
               XSETCDR (list_offset, Fcons (val, Qnil));
--- a/src/event-unixoid.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/event-unixoid.c	Mon Feb 08 21:28:57 2010 -0600
@@ -100,16 +100,16 @@
     ch = Lstream_get_ichar (XLSTREAM (CONSOLE_TTY_DATA (con)->instream));
   else
     {
-      Ibyte byte;
+      Ibyte ibyte;
       /* #### Definitely something strange here.  We should be setting
 	 the stdio handle unbuffered and reading from it instead of mixing
 	 stdio and raw io calls. */
       int nread = retry_read (fileno (CONSOLE_STREAM_DATA (con)->in),
-			      &byte, 1);
+			      &ibyte, 1);
       if (nread <= 0)
 	ch = -1;
       else
-        ch = byte;
+        ch = ibyte;
     }
 
   if (ch < 0)
@@ -132,7 +132,7 @@
 void
 signal_fake_event (void)
 {
-  char byte = 0;
+  Rawbyte rbyte = 0;
   /* We do the write always.  Formerly I tried to "optimize" this
      by setting a flag indicating whether we're blocking and only
      doing the write in that case, but there is a race condition
@@ -148,7 +148,7 @@
     /* In case a signal comes through while we're dumping */
     {
       int old_errno = errno;
-      retry_write (signal_event_pipe[1], &byte, 1);
+      retry_write (signal_event_pipe[1], &rbyte, 1);
       errno = old_errno;
     }
 }
@@ -156,7 +156,7 @@
 void
 drain_signal_event_pipe (void)
 {
-  char chars[128];
+  Rawbyte chars[128];
   /* The input end of the pipe has been set to non-blocking. */
   while (retry_read (signal_event_pipe[0], chars, sizeof (chars)) > 0)
     ;
--- a/src/frame.h	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/frame.h	Mon Feb 08 21:28:57 2010 -0600
@@ -154,7 +154,6 @@
 			     void *closure);
 int device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec);
 Lisp_Object frame_first_window (struct frame *f);
-int show_gc_cursor (struct frame *f, Lisp_Object cursor);
 void set_frame_selected_window (struct frame *f, Lisp_Object window);
 int is_surrogate_for_selected_frame (struct frame *f);
 void update_frame_icon (struct frame *f);
--- a/src/gc.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/gc.c	Mon Feb 08 21:28:57 2010 -0600
@@ -1449,7 +1449,7 @@
 #define MAX_SAVE_STACK 0 /* 16000 */
 #endif
 
-void
+static void
 show_gc_cursor_and_message (void) 
 {
   /* Now show the GC cursor/message. */
@@ -1506,7 +1506,7 @@
     }
 }
 
-void
+static void
 remove_gc_cursor_and_message (void)
 {
   /* Now remove the GC cursor/message */
@@ -1536,7 +1536,7 @@
     }
 }
 
-void
+static void
 gc_prepare (void)
 {
 #if MAX_SAVE_STACK > 0
@@ -1604,7 +1604,7 @@
   cleanup_buffer_undo_lists ();
 }
 
-void
+static void
 gc_mark_root_set (
 #ifdef NEW_GC
 		  enum gc_phase phase
@@ -1711,7 +1711,7 @@
 #endif
 }
 
-void
+static void
 gc_finish_mark (void)
 {
 #ifdef NEW_GC
@@ -1758,14 +1758,14 @@
 }
 
 #ifdef NEW_GC
-void
+static void
 gc_finalize (void)
 {
   GC_SET_PHASE (FINALIZE);
   register_for_finalization ();
 }
 
-void
+static void
 gc_sweep (void)
 {
   GC_SET_PHASE (SWEEP);
@@ -1774,7 +1774,7 @@
 #endif /* NEW_GC */
 
 
-void
+static void
 gc_finish (void)
 {
 #ifdef NEW_GC
@@ -1815,7 +1815,7 @@
 }
 
 #ifdef NEW_GC
-void
+static void
 gc_suspend_mark_phase (void)
 {
   PROFILE_RECORD_EXITING_SECTION (QSin_garbage_collection);
@@ -1824,7 +1824,7 @@
   vdb_start_dirty_bits_recording ();
 }
 
-int
+static int
 gc_resume_mark_phase (void)
 {
   PROFILE_RECORD_ENTERING_SECTION (QSin_garbage_collection);
@@ -1834,7 +1834,7 @@
   return vdb_read_dirty_bits ();
 }
 
-int
+static int
 gc_mark (int incremental)
 {
   GC_SET_PHASE (MARK);
@@ -1854,7 +1854,7 @@
   return 1;
 }
 
-int
+static int
 gc_resume_mark (int incremental)
 {
   if (!incremental)
--- a/src/glyphs-eimage.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/glyphs-eimage.c	Mon Feb 08 21:28:57 2010 -0600
@@ -598,7 +598,7 @@
 }
 
 static const char *
-gif_decode_error_string ()
+gif_decode_error_string (void)
 {
   switch (GifLastError ())
     {
--- a/src/intl-win32.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/intl-win32.c	Mon Feb 08 21:28:57 2010 -0600
@@ -1601,10 +1601,10 @@
 wchar_t *
 wcsncpy (wchar_t *dst0, const wchar_t *src0, size_t count)
 {
-  if (dst0 == NULL || src0 == NULL) return NULL;
   wchar_t *dscan;
   const wchar_t *sscan;
 
+  if (dst0 == NULL || src0 == NULL) return NULL;
   dscan = dst0;
   sscan = src0;
   while (count > 0)
--- a/src/lisp.h	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/lisp.h	Mon Feb 08 21:28:57 2010 -0600
@@ -99,7 +99,12 @@
    large so they shouldn't cause that much of a slowdown. */
 
 #include <stdlib.h>
+/* Evil, but ...  -Wshadow is genuinely useful but also leads to spurious
+   warnings when you have a local var named `index'.  Avoid this by
+   hacking around it. */
+#define index old_index
 #include <string.h>		/* primarily for memcpy, etc. */
+#undef index
 #include <stdio.h>		/* NULL, etc. */
 #include <ctype.h>
 #include <stdarg.h>
--- a/src/lread.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/lread.c	Mon Feb 08 21:28:57 2010 -0600
@@ -356,23 +356,23 @@
     len -= 3;
 
   {
-      EXTERNAL_LIST_LOOP_2 (acons, Vload_suppress_alist)
+    EXTERNAL_LIST_LOOP_2 (cons, Vload_suppress_alist)
       {
-	  if (CONSP (acons) && STRINGP (XCAR (acons)))
+	if (CONSP (cons) && STRINGP (XCAR (cons)))
 	  {
-	      Lisp_Object name = XCAR (acons);
-	      if (XSTRING_LENGTH (name) == len &&
-		  !memcmp (XSTRING_DATA (name), nonreloc, len))
+	    Lisp_Object name = XCAR (cons);
+	    if (XSTRING_LENGTH (name) == len &&
+		!memcmp (XSTRING_DATA (name), nonreloc, len))
 	      {
-		  struct gcpro gcpro1;
-		  Lisp_Object val;
-
-		  GCPRO1 (reloc);
-		  val = IGNORE_MULTIPLE_VALUES (Feval (XCDR (acons)));
-		  UNGCPRO;
-
-		  if (!NILP (val))
-		      return 1;
+		struct gcpro gcpro1;
+		Lisp_Object val;
+
+		GCPRO1 (reloc);
+		val = IGNORE_MULTIPLE_VALUES (Feval (XCDR (cons)));
+		UNGCPRO;
+
+		if (!NILP (val))
+		  return 1;
 	      }
 	  }
       }
--- a/src/number-gmp.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/number-gmp.c	Mon Feb 08 21:28:57 2010 -0600
@@ -76,18 +76,20 @@
 	 point, format identifier, and exponent */
       /* GMP's idea of the exponent is 1 greater than scientific notation's */
       expt--;
-      const int point = (len == neg + 2) ? 0 : 1;
-      const int exponent = (expt < 0)
-	? (int)(log ((double) (-expt)) / log ((double) base)) + 3
-	: (int)(log ((double) expt) / log ((double) base)) + 2;
-      const int space = point + exponent;
-      XREALLOC_ARRAY (str, CIbyte, len + space);
-      if (point > 0)
-	{
-	  memmove (&str[neg + 2], &str[neg + 1], len - neg);
-	  str[neg + 1] = '.';
-	}
-      sprintf (&str[len + point - 1], "E%ld", expt);
+      {
+	const int point = (len == neg + 2) ? 0 : 1;
+	const int exponent = (expt < 0)
+	  ? (int)(log ((double) (-expt)) / log ((double) base)) + 3
+	  : (int)(log ((double) expt) / log ((double) base)) + 2;
+	const int space = point + exponent;
+	XREALLOC_ARRAY (str, CIbyte, len + space);
+	if (point > 0)
+	  {
+	    memmove (&str[neg + 2], &str[neg + 1], len - neg);
+	    str[neg + 1] = '.';
+	  }
+	sprintf (&str[len + point - 1], "E%ld", expt);
+      }
     }
   return str;
 }
--- a/src/objects-msw.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/objects-msw.c	Mon Feb 08 21:28:57 2010 -0600
@@ -2070,6 +2070,7 @@
     {
       HDC hdc = CreateCompatibleDC (NULL);
       Lisp_Object font_list = Qnil, truename; 
+      HFONT hfont;
 
       if (DEVICE_TYPE_P (d, mswindows))
 	{
@@ -2084,10 +2085,10 @@
 	  assert(0);
 	}
 
-      HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
-						 font_list,
-						 ERROR_ME_DEBUG_WARN,
-						 &truename);
+      hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
+					   font_list,
+					   ERROR_ME_DEBUG_WARN,
+					   &truename);
 
       if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont)))
 	{
--- a/src/search.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/search.c	Mon Feb 08 21:28:57 2010 -0600
@@ -1437,13 +1437,13 @@
 		         is not involved--but this is not a critical
 		         issue. */
 		      Ibyte encoded[MAX_ICHAR_LEN];
-		      Bytecount len = set_itext_ichar (encoded, c);
-		      int i, j;
-		      for (i = 0; i < len && boyer_moore_ok; ++i)
+		      Bytecount clen = set_itext_ichar (encoded, c);
+		      int a, b;
+		      for (a = 0; a < clen && boyer_moore_ok; ++a)
 			{
-			  for (j = i + 1; j < len && boyer_moore_ok; ++j)
+			  for (b = a + 1; b < clen && boyer_moore_ok; ++b)
 			    {
-			      if (encoded[i] == encoded[j])
+			      if (encoded[a] == encoded[b])
 				{
 				  boyer_moore_ok = 0;
 				}
--- a/src/specifier.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/specifier.c	Mon Feb 08 21:28:57 2010 -0600
@@ -1072,8 +1072,8 @@
 {
   struct gcpro gcpro1;
   Lisp_Object charpres = make_vector (NUM_MATCHSPEC_STAGES, Qnil);
+  int max_args = XINT (Ffunction_max_args (charset_predicate));
   GCPRO1 (charpres);
-  int max_args = XINT (Ffunction_max_args (charset_predicate));
     
 
 #define DEFINE_SPECIFIER_TAG_FROB(stage, enumstage)		\
--- a/src/strftime.c	Mon Feb 08 16:51:25 2010 -0600
+++ b/src/strftime.c	Mon Feb 08 21:28:57 2010 -0600
@@ -396,13 +396,13 @@
             case 'G':
               {
                 int year = tm->tm_year + 1900;
-                int days = iso_week_days (tm->tm_yday, tm->tm_wday);
+                int ndays = iso_week_days (tm->tm_yday, tm->tm_wday);
 
-                if (days < 0)
+                if (ndays < 0)
                   {
                     /* This ISO week belongs to the previous year.  */
                     year--;
-                    days =
+                    ndays =
                       iso_week_days (tm->tm_yday + (365 + __isleap (year)),
                                      tm->tm_wday);
                   }
@@ -415,7 +415,7 @@
                       {
                         /* This ISO week belongs to the next year.  */
                         year++;
-                        days = d;
+                        ndays = d;
                       }
                   }
 
@@ -442,7 +442,7 @@
                     
                   default:
                     length +=
-                      add_num2 (&string[length], days / 7 + 1,
+                      add_num2 (&string[length], ndays / 7 + 1,
                                 max - length, pad);
                     break;
                   }
@@ -474,7 +474,7 @@
                 /* tm diff code below is based on mktime.c, glibc 2.3.2 */
                 {
                   int lt4, ut4, lt100, ut100, lt400, ut400;
-                  int intervening_leap_days, years, days;
+                  int intervening_leap_days, years, ndays;
 
                   lt4 = (lt.tm_year >> 2) + (1900 >> 2) -
                     ! (lt.tm_year & 3);
@@ -487,9 +487,10 @@
                   intervening_leap_days =
                     (lt4 - ut4) - (lt100 - ut100) + (lt400 - ut400);
                   years = lt.tm_year - ut->tm_year;
-                  days = (365 * years + intervening_leap_days
+                  ndays = (365 * years + intervening_leap_days
                           + (lt.tm_yday - ut->tm_yday));
-                  offset = (60 * (60 * (24 * days + (lt.tm_hour - ut->tm_hour))
+                  offset = (60 * (60 * (24 * ndays
+					+ (lt.tm_hour - ut->tm_hour))
                                  + (lt.tm_min - ut->tm_min))
                            + (lt.tm_sec - ut->tm_sec));
                 }