diff -urN rxvt-unicode-9.31-orig/configure rxvt-unicode-9.31/configure
--- rxvt-unicode-9.31-orig/configure	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/configure	2023-04-22 06:14:44 +0900
@@ -672,6 +672,7 @@
 XMKMF
 TIC
 RXVTNAME
+LIBEV_CFLAGS
 LINKER
 INSTALL_DATA
 INSTALL_SCRIPT
@@ -732,7 +733,6 @@
 enable_option_checking
 enable_everything
 enable_assert
-enable_warnings
 enable_256_color
 enable_unicode3
 enable_combining
@@ -1406,7 +1406,6 @@
   --enable-everything     enable standard non-multichoice features
                           NOTE: this option is order dependent
   --enable-assert         enable assertions
-  --enable-warnings       turn on g++ warnings
   --enable-256-color      enable 256-color support
   --enable-unicode3       use 21 instead of 16 bits to represent unicode characters
   --enable-combining      enable composition of base and combining characters
@@ -4790,12 +4789,95 @@
   CXXFLAGS="-g -O3"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    # libev deliberately uses struct aliasing, so we need to force aliasing
+    # optimizations off.  This flag is supported by GCC and presumably by
+    # all GCC-lookalikes, but in case of failure, just disable optimization
+    # completely to be safe
+    CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+
+else $as_nop
+  CXXFLAGS="-g -O0"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    save_CXXFLAGS="$CXXFLAGS"
+    # Omitted warnings:
+    #    -Wreorder: generally useless; excessively complex to work around
+    #    -Wunused-result: triggers on legitimately ignored results;
+    #        excessively complex to work around
+    #    -Wunused-value: for libev and libecb
+    #    -Wunused-variable: for autogenerated rxvtperl code
+    for warning in \
+      -Wall \
+      -Wno-reorder \
+      -Wno-unused-result \
+      -Wno-unused-value \
+      -Wno-unused-variable \
+      ; do
+      CXXFLAGS="$CXXFLAGS $warning"
+    done
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+
+else $as_nop
+  CXXFLAGS="$save_CXXFLAGS"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   else
     CXXFLAGS="-O"
   fi
   CFLAGS="$CXXFLAGS"
 fi
 
+LIBEV_CFLAGS=""
+if test x$GCC = xyes; then  # for libev
+  LIBEV_CFLAGS="-Wno-comment -Wno-parentheses -Wno-sign-compare"
+  save_CFLAGS="$CFLAGS"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+
+else $as_nop
+  LIBEV_CFLAGS=""
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+fi
+
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setlocale" >&5
 printf %s "checking for library containing setlocale... " >&6; }
 if test ${ac_cv_search_setlocale+y}
@@ -5070,50 +5152,6 @@
 
 fi
 
-support_warnings=no
-# Check whether --enable-warnings was given.
-if test ${enable_warnings+y}
-then :
-  enableval=$enable_warnings; if test x$enableval = xyes; then
-    support_warnings=yes
-  fi
-fi
-
-if test x$GXX = xyes; then
-  if test $support_warnings = yes; then
-    save_CXXFLAGS="$CXXFLAGS"
-    for warning in \
-      -Wall \
-      -Wno-parentheses \
-      -Wno-reorder \
-      -Wno-sign-compare \
-      -Wno-unused-value \
-      ; do
-      CXXFLAGS="$CXXFLAGS $warning"
-    done
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main (void)
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"
-then :
-
-else $as_nop
-  CXXFLAGS="$save_CXXFLAGS"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-  else
-    CXXFLAGS="$CXXFLAGS -w"
-  fi
-fi
-
 support_256_color=no
 # Check whether --enable-256-color was given.
 if test ${enable_256_color+y}
diff -urN rxvt-unicode-9.31-orig/configure.ac rxvt-unicode-9.31/configure.ac
--- rxvt-unicode-9.31-orig/configure.ac	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/configure.ac	2023-04-22 06:14:26 +0900
@@ -56,12 +56,44 @@
   if test x$GCC = xyes && test "x$GXX" = xyes; then
     CXXFLAGS="-g -O3 -fno-rtti -fvisibility-inlines-hidden -fno-threadsafe-statics -fno-enforce-eh-specs"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="-g -O3"])
+    # libev deliberately uses struct aliasing, so we need to force aliasing
+    # optimizations off.  This flag is supported by GCC and presumably by
+    # all GCC-lookalikes, but in case of failure, just disable optimization
+    # completely to be safe
+    CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="-g -O0"])
+    save_CXXFLAGS="$CXXFLAGS"
+    # Omitted warnings:
+    #    -Wreorder: generally useless; excessively complex to work around
+    #    -Wunused-result: triggers on legitimately ignored results;
+    #        excessively complex to work around
+    #    -Wunused-value: for libev and libecb
+    #    -Wunused-variable: for autogenerated rxvtperl code
+    for warning in \
+      -Wall \
+      -Wno-reorder \
+      -Wno-unused-result \
+      -Wno-unused-value \
+      -Wno-unused-variable \
+      ; do
+      CXXFLAGS="$CXXFLAGS $warning"
+    done
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="$save_CXXFLAGS"])
   else
     CXXFLAGS="-O"
   fi
   CFLAGS="$CXXFLAGS"
 fi
 
+LIBEV_CFLAGS=""
+if test x$GCC = xyes; then  # for libev
+  LIBEV_CFLAGS="-Wno-comment -Wno-parentheses -Wno-sign-compare"
+  save_CFLAGS="$CFLAGS"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [LIBEV_CFLAGS=""])
+  CFLAGS="$save_CFLAGS"
+fi
+AC_SUBST(LIBEV_CFLAGS)
+
 dnl# FreeBSD needs to link libxpg4
 AC_SEARCH_LIBS(setlocale,     xpg4)
 
@@ -163,30 +195,6 @@
   AC_DEFINE(NDEBUG, 1, Disable assertions (good for debugging))
 fi
 
-support_warnings=no
-AC_ARG_ENABLE(warnings,
-  [  --enable-warnings       turn on g++ warnings],
-  [if test x$enableval = xyes; then
-    support_warnings=yes
-  fi])
-if test x$GXX = xyes; then
-  if test $support_warnings = yes; then
-    save_CXXFLAGS="$CXXFLAGS"
-    for warning in \
-      -Wall \
-      -Wno-parentheses \
-      -Wno-reorder \
-      -Wno-sign-compare \
-      -Wno-unused-value \
-      ; do
-      CXXFLAGS="$CXXFLAGS $warning"
-    done
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="$save_CXXFLAGS"])
-  else
-    CXXFLAGS="$CXXFLAGS -w"
-  fi
-fi
-
 support_256_color=no
 AC_ARG_ENABLE(256-color,
   [  --enable-256-color      enable 256-color support],
diff -urN rxvt-unicode-9.31-orig/libev/ev.c rxvt-unicode-9.31/libev/ev.c
--- rxvt-unicode-9.31-orig/libev/ev.c	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/libev/ev.c	2023-04-22 06:06:52 +0900
@@ -37,10 +37,6 @@
  * either the BSD or the GPL.
  */
 
-#pragma clang diagnostic ignored "-Wunused-value"
-#pragma clang diagnostic ignored "-Wcomment"
-#pragma clang diagnostic ignored "-Wextern-initializer"
-
 /* this big block deduces configuration from config.h */
 #ifndef EV_STANDALONE
 # ifdef EV_CONFIG_H
@@ -1483,7 +1479,7 @@
 ecb_binary32_to_binary16 (uint32_t x)
 {
   unsigned int s =  (x >> 16) & 0x00008000; /* sign bit, the easy part */
-  unsigned int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */
+  int          e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */
   unsigned int m =   x        & 0x007fffff;
 
   x &= 0x7fffffff;
@@ -2257,7 +2253,7 @@
   while (cnt > ncur);
 
   /* if size is large, round to MALLOC_ROUND - 4 * longs to accommodate malloc overhead */
-  if (elem * ncur > MALLOC_ROUND - sizeof (void *) * 4)
+  if ((size_t)elem * ncur > MALLOC_ROUND - sizeof (void *) * 4)
     {
       ncur *= elem;
       ncur = (ncur + elem + (MALLOC_ROUND - 1) + sizeof (void *) * 4) & ~(MALLOC_ROUND - 1);
@@ -4359,7 +4355,7 @@
   /* common bug, apparently */
   assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w));
 
-  fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY);
+  fd_change (EV_A_ fd, (w->events & EV__IOFDSET) | EV_ANFD_REIFY);
   w->events &= ~EV__IOFDSET;
 
   EV_FREQUENT_CHECK;
diff -urN rxvt-unicode-9.31-orig/libev/ev.h rxvt-unicode-9.31/libev/ev.h
--- rxvt-unicode-9.31-orig/libev/ev.h	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/libev/ev.h	2023-04-22 06:06:52 +0900
@@ -694,7 +694,7 @@
   ev_set_cb ((ev), cb_);			\
 } while (0)
 
-#define ev_io_modify(ev,events_)             do { (ev)->events = (ev)->events & EV__IOFDSET | (events_); } while (0)
+#define ev_io_modify(ev,events_)             do { (ev)->events = ((ev)->events & EV__IOFDSET) | (events_); } while (0)
 #define ev_io_set(ev,fd_,events_)            do { (ev)->fd = (fd_); (ev)->events = (events_) | EV__IOFDSET; } while (0)
 #define ev_timer_set(ev,after_,repeat_)      do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
 #define ev_periodic_set(ev,ofs_,ival_,rcb_)  do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb = (rcb_); } while (0)
diff -urN rxvt-unicode-9.31-orig/src/Makefile.in rxvt-unicode-9.31/src/Makefile.in
--- rxvt-unicode-9.31-orig/src/Makefile.in	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/Makefile.in	2023-04-22 06:06:52 +0900
@@ -26,6 +26,7 @@
 COMPILE = $(CXX) -I.. -I$(srcdir) -I. -I$(srcdir)/../libev $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(XINC)
 LINK = @LINKER@ $(LDFLAGS)
 EXEEXT = @EXEEXT@
+LIBEV_CFLAGS = @LIBEV_CFLAGS@
 PERLFLAGS = @PERLFLAGS@
 PERLLIB = @PERLLIB@
 
@@ -135,6 +136,10 @@
 
 install: install-bin install-perl
 
+
+ev_cpp.o: ev_cpp.C
+	$(COMPILE) $(LIBEV_CFLAGS) -c $<
+
 perlxsi.c: Makefile
 	$(PERL) -MExtUtils::Embed -e xsinit -- -std urxvt
 
diff -urN rxvt-unicode-9.31-orig/src/command.C rxvt-unicode-9.31/src/command.C
--- rxvt-unicode-9.31-orig/src/command.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/command.C	2023-04-22 06:06:52 +0900
@@ -885,58 +885,60 @@
 #if ENABLE_FRILLS || ISO_14755
   // ISO 14755 support
   if (iso14755buf)
-    if (iso14755buf & ISO_14755_52)
-      {
+    {
+      if (iso14755buf & ISO_14755_52)
+        {
 # if ISO_14755
-        scr_overlay_off ();
+          scr_overlay_off ();
 # endif
 # if ISO_14755
-        // iso14755 part 5.2 handling: release time
-        // first: controls
-        if ((ev.state & ControlMask)
-             && ((keysym >= 0x40 && keysym <= 0x5f)
-                 || (keysym >= 0x61 && keysym <= 0x7f)))
-          {
-            iso14755buf = ISO_14755_51 | 0x2400 | (keysym & 0x1f);
-            commit_iso14755 ();
-
-            return;
-          }
-
-        for (unsigned short *i = iso14755_symtab; i[0]; i += 2)
-          if (i[0] == keysym)
+          // iso14755 part 5.2 handling: release time
+          // first: controls
+          if ((ev.state & ControlMask)
+               && ((keysym >= 0x40 && keysym <= 0x5f)
+                   || (keysym >= 0x61 && keysym <= 0x7f)))
             {
-              iso14755buf = ISO_14755_51 | i[1];
+              iso14755buf = ISO_14755_51 | 0x2400 | (keysym & 0x1f);
               commit_iso14755 ();
-
+  
               return;
             }
-
-        scr_bell ();
+  
+          for (unsigned short *i = iso14755_symtab; i[0]; i += 2)
+            if (i[0] == keysym)
+              {
+                iso14755buf = ISO_14755_51 | i[1];
+                commit_iso14755 ();
+  
+                return;
+              }
+  
+          scr_bell ();
 # endif
-        iso14755buf = 0;
-
-        return;
-      }
-    else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask))
-      {
+          iso14755buf = 0;
+  
+          return;
+        }
+      else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask))
+        {
 # if ISO_14755
-        scr_overlay_off ();
+          scr_overlay_off ();
 # endif
-        if (iso14755buf & ISO_14755_51)
-          commit_iso14755 ();
-#if ISO_14755
-        else if (option (Opt_iso14755_52) && iso14755buf & ISO_14755_STARTED)
-          {
-            iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair
-
-            scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1);
-            scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE");
-          }
+          if (iso14755buf & ISO_14755_51)
+            commit_iso14755 ();
+# if ISO_14755
+          else if (option (Opt_iso14755_52) && (iso14755buf & ISO_14755_STARTED))
+            {
+              iso14755buf = ISO_14755_52; // iso14755 part 5.2: remember empty begin/end pair
+  
+              scr_overlay_new (0, -1, sizeof ("KEYCAP PICTURE INSERT MODE") - 1, 1);
+              scr_overlay_set (0, 0, "KEYCAP PICTURE INSERT MODE");
+            }
 # endif
-        else
-          iso14755buf = 0;
-      }
+          else
+            iso14755buf = 0;
+        }
+    }
 #endif
 
   if (HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_INT, keysym, DT_END)))
@@ -1414,13 +1416,13 @@
               {
                 if (!HOOK_INVOKE ((this, HOOK_WM_PROTOCOLS, DT_XEVENT, &ev, DT_END)))
                   {
-                    if (ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW])
+                    if ((Atom)ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW])
                       {
                         if (!HOOK_INVOKE ((this, HOOK_WM_DELETE_WINDOW, DT_XEVENT, &ev, DT_END)))
                           destroy ();
                       }
 #if ENABLE_EWMH
-                    else if (ev.xclient.data.l[0] == xa[XA_NET_WM_PING])
+                    else if ((Atom)ev.xclient.data.l[0] == xa[XA_NET_WM_PING])
                       XSendEvent (dpy, ev.xclient.window = display->root,
                                   False, SubstructureRedirectMask | SubstructureNotifyMask,
                                   &ev);
@@ -1725,7 +1727,7 @@
 
   if (XWMHints *h = XGetWMHints (dpy, parent))
     {
-      h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0);
+      h->flags = (h->flags & ~XUrgencyHint) | (enable ? XUrgencyHint : 0);
       XSetWMHints (dpy, parent, h);
       urgency_hint = enable;
       XFree (h);
@@ -3144,7 +3146,7 @@
         XMoveWindow (dpy, parent, args[1], args[2]);
         break;
       case 4:			/* set size (pixels) */
-        set_widthheight ((unsigned int)args[2], (unsigned int)args[1]);
+        set_widthheight (args[2], args[1]);
         break;
       case 5:			/* raise window */
         XRaiseWindow (dpy, parent);
@@ -3156,15 +3158,13 @@
         scr_touch (true);
         break;
       case 8:			/* set size (chars) */
-        set_widthheight ((unsigned int) (args[2] * fwidth),
-                         (unsigned int) (args[1] * fheight));
+        set_widthheight (args[2] * fwidth, args[1] * fheight);
         break;
 
       //case 9: NYI, TODO, restore maximized window or maximize window
       default:
         if (args[0] >= 24)	/* set height (chars) */
-          set_widthheight ((unsigned int)vt_width,
-                           (unsigned int) (args[1] * fheight));
+          set_widthheight (vt_width, args[1] * fheight);
         break;
 
       /*
@@ -3368,7 +3368,7 @@
 
   unsigned int idx;
 
-  for (int n = 0; n < ecb_array_length (dxyz) - 2; ++n)
+  for (unsigned int n = 0; n < ecb_array_length (dxyz) - 2; ++n)
     {
       unsigned int idx_r = color_level[  Red_levels - dxyz[n + 0]][r / 8];
       unsigned int idx_g = color_level[Green_levels - dxyz[n + 1]][g / 8];
@@ -3805,10 +3805,12 @@
 #endif
           case 1048:		/* alternative cursor save */
             if (option (Opt_secondaryScreen))
-              if (mode == 0)
-                scr_cursor (RESTORE);
-              else if (mode == 1)
-                scr_cursor (SAVE);
+              {
+                if (mode == 0)
+                  scr_cursor (RESTORE);
+                else if (mode == 1)
+                  scr_cursor (SAVE);
+              }
             break;
         }
 
@@ -3906,10 +3908,12 @@
               scr_change_screen (state);
 
               if (option (Opt_secondaryScreen))
-                if (state)
-                  scr_erase_screen (2);
-                else
-                  scr_cursor (RESTORE);
+                {
+                  if (state)
+                    scr_erase_screen (2);
+                  else
+                    scr_cursor (RESTORE);
+                }
               break;
             default:
               break;
diff -urN rxvt-unicode-9.31-orig/src/emman.c rxvt-unicode-9.31/src/emman.c
--- rxvt-unicode-9.31-orig/src/emman.c	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/emman.c	2023-04-22 06:06:52 +0900
@@ -61,7 +61,7 @@
 chunk_fit (size_t header, size_t element_size, size_t max_increase)
 {
   uint32_t fill, maximum_fill = 0;
-  size_t minimum_size;
+  size_t minimum_size = 0;
 
   max_increase += header + element_size;
 
diff -urN rxvt-unicode-9.31-orig/src/encoding.C rxvt-unicode-9.31/src/encoding.C
--- rxvt-unicode-9.31-orig/src/encoding.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/encoding.C	2023-04-22 06:06:52 +0900
@@ -142,10 +142,14 @@
   return CS_UNKNOWN;
 }
 
+#if ENCODING_TO_UNICODE
 static unicode_t cs_unknown_to_unicode (uint32_t enc)          { return NOCHAR; }
+#endif
 static uint32_t cs_unknown_from_unicode (unicode_t unicode)    { return NOCHAR; }
 
+#if ENCODING_TO_UNICODE
 static unicode_t cs_unicode_to_unicode (uint32_t enc)          { return enc; }
+#endif
 static uint32_t cs_unicode_from_unicode (unicode_t unicode)    { return unicode; }
 
 #define cs_us_ascii_to_unicode cs_unicode_to_unicode
diff -urN rxvt-unicode-9.31-orig/src/init.C rxvt-unicode-9.31/src/init.C
--- rxvt-unicode-9.31-orig/src/init.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/init.C	2023-04-22 06:06:52 +0900
@@ -702,14 +702,16 @@
 
   rewrap_always = rewrap_never = 0;
   if (const char *v = rs[Rs_rewrapMode])
-    if (!strcmp (v, "never"))
-      rewrap_never = 1;
-    else if (!strcmp (v, "always"))
-      rewrap_always = 1;
-    else if (!strcmp (v, "auto"))
-      /* nop **/;
-    else
-      rxvt_warn ("invalid rewrapMode, must be auto, always or never.\n");
+    {
+      if (!strcmp (v, "never"))
+        rewrap_never = 1;
+      else if (!strcmp (v, "always"))
+        rewrap_always = 1;
+      else if (!strcmp (v, "auto"))
+        /* nop **/;
+      else
+        rxvt_warn ("invalid rewrapMode, must be auto, always or never.\n");
+    }
 #endif
 
 #ifdef POINTER_BLANK
@@ -808,7 +810,7 @@
   this->envv = envv;
 
   env = new char *[this->envv->size ()];
-  for (int i = 0; i < this->envv->size (); i++)
+  for (unsigned int i = 0; i < this->envv->size (); i++)
     env[i] = this->envv->at (i);
 
   init2 (argv->size () - 1, argv->begin ());
@@ -1305,9 +1307,9 @@
 
       buffer [0] = w;
       buffer [1] = h;
-      for (int i = 0; i < h; i++)
+      for (unsigned int i = 0; i < h; i++)
         {
-          for (int j = 0; j < w; j++)
+          for (unsigned int j = 0; j < w; j++)
             {
               unsigned char *pixel = row + j * channels;
               long value;
diff -urN rxvt-unicode-9.31-orig/src/main.C rxvt-unicode-9.31/src/main.C
--- rxvt-unicode-9.31-orig/src/main.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/main.C	2023-04-22 06:06:52 +0900
@@ -63,7 +63,7 @@
 bool
 rxvt_set_locale (const char *locale) noexcept
 {
-  int size = strlen (locale) + 1;
+  unsigned int size = strlen (locale) + 1;
 
   if (size > sizeof (curlocale))
     rxvt_fatal ("locale string too long, aborting.\n");
@@ -90,7 +90,7 @@
 }
 
 #if ENABLE_COMBINING
-class rxvt_composite_vec rxvt_composite;
+struct rxvt_composite_vec rxvt_composite;
 
 text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2)
 {
@@ -267,7 +267,7 @@
   scr_release ();
 
   /* clear all resources */
-  for (int i = 0; i < allocated.size (); i++)
+  for (unsigned int i = 0; i < allocated.size (); i++)
     free (allocated [i]);
 
   free (selection.text);
@@ -370,7 +370,7 @@
   uint8_t mask = 1 << (opt & 7);
   uint8_t &val = options [opt >> 3];
 
-  val = val & ~mask | (set ? mask : 0);
+  val = (val & ~mask) | (set ? mask : 0);
 }
 
 /*----------------------------------------------------------------------*/
@@ -390,21 +390,21 @@
 static void ecb_cold
 print_x_error (Display *dpy, XErrorEvent *event)
 {
-  char buffer[BUFSIZ];
+  char buffer[BUFSIZ+4];
   char mesg[BUFSIZ];
   char number[32];
 
   rxvt_warn ("An X Error occurred, trying to continue after report.\n");
 
-  XGetErrorDatabaseText (dpy, "XlibMessage", "ErrorSerial", "Error Serial #%d", mesg, BUFSIZ);
-  snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->serial);
+  XGetErrorDatabaseText (dpy, "XlibMessage", "ErrorSerial", "Error Serial #%d", mesg, sizeof(mesg));
+  snprintf (buffer, sizeof(buffer), "+ %s\n", mesg); rxvt_warn (buffer, event->serial);
 
-  XGetErrorText (dpy, event->error_code, buffer, BUFSIZ);
-  XGetErrorDatabaseText (dpy, "XlibMessage", "XError", "X Error", mesg, BUFSIZ);
+  XGetErrorText (dpy, event->error_code, buffer, sizeof(buffer));
+  XGetErrorDatabaseText (dpy, "XlibMessage", "XError", "X Error", mesg, sizeof(mesg));
   rxvt_warn ("+ %s: %s\n", mesg, buffer);
 
-  XGetErrorDatabaseText (dpy, "XlibMessage", "MajorCode", "Request Major code %d", mesg, BUFSIZ);
-  snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->request_code);
+  XGetErrorDatabaseText (dpy, "XlibMessage", "MajorCode", "Request Major code %d", mesg, sizeof(mesg));
+  snprintf (buffer, sizeof(buffer), "+ %s\n", mesg); rxvt_warn (buffer, event->request_code);
 
   if (event->request_code >= 128)
     {
@@ -420,11 +420,11 @@
 
           if (XQueryExtension (dpy, extname, &major, &first_event, &first_error) && major == event->request_code)
             {
-              XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, BUFSIZ);
+              XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, sizeof(mesg));
               rxvt_warn ("+ (which is extension %s minor code %d)\n", extname, event->minor_code);
 
-              snprintf (buffer, BUFSIZ, "%s.%d", extname, event->minor_code);
-              XGetErrorDatabaseText (dpy, "XRequest", buffer, "an unregistered minor code", buffer, BUFSIZ);
+              snprintf (buffer, sizeof(buffer), "%s.%d", extname, event->minor_code);
+              XGetErrorDatabaseText (dpy, "XRequest", buffer, "an unregistered minor code", buffer, sizeof(buffer));
               rxvt_warn ("+ (which is %s)\n", buffer);
 
               break;
@@ -443,12 +443,12 @@
         {
           rxvt_warn ("+ (which is an unknown extension)\n", buffer);
 
-          XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, BUFSIZ);
-          snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->minor_code);
+          XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "Request Minor code %d", mesg, sizeof(mesg));
+          snprintf (buffer, sizeof(buffer), "+ %s\n", mesg); rxvt_warn (buffer, event->minor_code);
 
 #if 0
           sprintf (number, "RENDER.%d", event->minor_code);
-          XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, BUFSIZ);
+          XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, sizeof(buffer));
           rxvt_warn ("+ (which is %s)\n", buffer);
 #endif
         }
@@ -458,7 +458,7 @@
   else
     {
       sprintf (number, "%d", event->request_code);
-      XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, BUFSIZ);
+      XGetErrorDatabaseText (dpy, "XRequest", number, "", buffer, sizeof(buffer));
       rxvt_warn ("+ (which is %s)\n", buffer);
     }
 
@@ -474,13 +474,13 @@
       || event->error_code == BadAtom)
     {
       if (event->error_code == BadValue)
-        XGetErrorDatabaseText (dpy, "XlibMessage", "Value", "Value 0x%x", mesg, BUFSIZ);
+        XGetErrorDatabaseText (dpy, "XlibMessage", "Value", "Value 0x%x", mesg, sizeof(mesg));
       else if (event->error_code == BadAtom)
-        XGetErrorDatabaseText (dpy, "XlibMessage", "AtomID", "AtomID 0x%x", mesg, BUFSIZ);
+        XGetErrorDatabaseText (dpy, "XlibMessage", "AtomID", "AtomID 0x%x", mesg, sizeof(mesg));
       else
-        XGetErrorDatabaseText (dpy, "XlibMessage", "ResourceID", "ResourceID 0x%x", mesg, BUFSIZ);
+        XGetErrorDatabaseText (dpy, "XlibMessage", "ResourceID", "ResourceID 0x%x", mesg, sizeof(mesg));
 
-      snprintf (buffer, BUFSIZ, "+ %s\n", mesg); rxvt_warn (buffer, event->resourceid);
+      snprintf (buffer, sizeof(buffer), "+ %s\n", mesg); rxvt_warn (buffer, event->resourceid);
     }
 }
 #endif
@@ -648,7 +648,7 @@
  * if width/height are non-zero then override calculated width/height
  */
 void
-rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
+rxvt_term::window_calc (int newwidth, int newheight)
 {
   short recalc_x, recalc_y;
   int x, y, flags;
@@ -740,7 +740,7 @@
   szHint.min_width  = szHint.base_width + szHint.width_inc;
   szHint.min_height = szHint.base_height + szHint.height_inc;
 
-  if (newwidth && newwidth - szHint.base_width < max_width)
+  if (newwidth && newwidth - szHint.base_width < (int)max_width)
     {
       szHint.width = newwidth;
       width = newwidth - szHint.base_width;
@@ -751,7 +751,7 @@
       szHint.width = szHint.base_width + width;
     }
 
-  if (newheight && newheight - szHint.base_height < max_height)
+  if (newheight && newheight - szHint.base_height < (int)max_height)
     {
       szHint.height = newheight;
       height = newheight - szHint.base_height;
@@ -1075,7 +1075,7 @@
  * -                         WINDOW RESIZING                          - *
  * -------------------------------------------------------------------- */
 void
-rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent)
+rxvt_term::resize_all_windows (int newwidth, int newheight, int ignoreparent)
 {
   int fix_screen;
   int old_width  = szHint.width;
@@ -1173,7 +1173,7 @@
  * good for toggling 80/132 columns
  */
 void
-rxvt_term::set_widthheight (unsigned int newwidth, unsigned int newheight)
+rxvt_term::set_widthheight (int newwidth, int newheight)
 {
   XWindowAttributes wattr;
 
@@ -1245,9 +1245,9 @@
   if (char *p = XSetLocaleModifiers (0))
     {
       strcpy (server, "@server=");
-      strncat (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */
+      strncat (server, p + 4, sizeof(server) - 9); /* skip "@im=" */
 
-      if (p = strchr (server + 1, '@'))      /* first one only */
+      if ((p = strchr (server + 1, '@')) != NULL)  /* first one only */
         *p = '\0';
 
       atom = XInternAtom (dpy, server, False);
@@ -1620,7 +1620,7 @@
           if (*s[i])
             {
               strcpy (buf, "@im=");
-              strncat (buf, s[i], IMBUFSIZ - 5);
+              strncat (buf, s[i], sizeof(buf) - 5);
               if (im_get_ic (buf))
                 {
                   found = true;
diff -urN rxvt-unicode-9.31-orig/src/rclock.C rxvt-unicode-9.31/src/rclock.C
--- rxvt-unicode-9.31-orig/src/rclock.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rclock.C	2023-04-22 06:06:52 +0900
@@ -1330,13 +1330,12 @@
             {
               if (strlen (text))
                 {
-                  int n = (sizeof (message) - strlen (message) - 3);
+                  int n = sizeof (message) - strlen (message);
 
-                  if (n > 0)
+                  if (n > 3)
                     {
                       /* for co-occurring events */
-                      strcat (message, "\\n");
-                      strncat (message, text, n);
+                      snprintf (message, n, "\\n%.*s", n-3, text);
                     }
                 }
 # ifndef NO_REMINDER_EXEC
@@ -1344,7 +1343,7 @@
                 {
                   int n = (sizeof (execPrgm) - strlen (execPrgm) - 2);
 
-                  if ((n > 0) && (n >= strlen (prgm)))
+                  if ((n > 0) && ((size_t)n >= strlen (prgm)))
                     {
                       /* for co-occurring programs */
                       switch (execPrgm[strlen (execPrgm) - 1])
diff -urN rxvt-unicode-9.31-orig/src/rxvt.h rxvt-unicode-9.31/src/rxvt.h
--- rxvt-unicode-9.31-orig/src/rxvt.h	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvt.h	2023-04-22 06:06:52 +0900
@@ -783,7 +783,7 @@
 #if UNICODE_3
 # define COMPOSE_LO 0x110000UL
 # define COMPOSE_HI 0x1fffffUL
-# define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO)
+# define IS_COMPOSE(n) ((int32_t)(n) >= (int32_t)COMPOSE_LO)
 #else
 # if ENABLE_PERL
 #  define COMPOSE_LO 0xe000UL // our _own_ functions don't like (illegal) surrogates
@@ -826,7 +826,7 @@
   }
 };
 
-extern class rxvt_composite_vec rxvt_composite;
+extern struct rxvt_composite_vec rxvt_composite;
 #endif
 
 #if 0
@@ -1157,7 +1157,6 @@
 # ifdef POINTER_BLANK
                   pointerBlankDelay,
 # endif
-                  multiClickTime,
                   cursor_type,
                   allowedxerror;
 /* ---------- */
@@ -1169,7 +1168,8 @@
 /* ---------- */
   Atom            *xa;
 /* ---------- */
-  Time            selection_time,
+  Time            multiClickTime,
+                  selection_time,
                   clipboard_time;
   rxvt_selection *selection_req;
   pid_t           cmd_pid;    /* process id of child */
@@ -1400,8 +1400,8 @@
   void destroy ();
   void emergency_cleanup ();
   void recolor_cursor ();
-  void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent);
-  void window_calc (unsigned int newwidth, unsigned int newheight);
+  void resize_all_windows (int newwidth, int newheight, int ignoreparent);
+  void window_calc (int newwidth, int newheight);
   bool set_fonts ();
   void set_string_property (Atom prop, const char *str, int len = -1);
   void set_mbstring_property (Atom prop, const char *str, int len = -1);
@@ -1412,7 +1412,7 @@
   char *get_colorfgbg ();
   bool set_color (rxvt_color &color, const char *name);
   void alias_color (int dst, int src);
-  void set_widthheight (unsigned int newwidth, unsigned int newheight);
+  void set_widthheight (int newwidth, int newheight);
   void get_window_origin (int &x, int &y);
 
   // screen.C
diff -urN rxvt-unicode-9.31-orig/src/rxvtfont.C rxvt-unicode-9.31/src/rxvtfont.C
--- rxvt-unicode-9.31-orig/src/rxvtfont.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvtfont.C	2023-04-22 06:06:52 +0900
@@ -232,7 +232,9 @@
 rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const
 {
   dTermDisplay;
+#if !XFT
   dTermGC;
+#endif
 
   if (color == Color_bg || color == Color_transparent)
     XClearArea (disp, d, x, y, w, h, false);
@@ -681,7 +683,7 @@
 replace_field (char **ptr, const char *name, int index, const char old, const char *replace)
 {
   int slashes = 0;
-  const char *field, *end;
+  const char *field = name, *end = name;
 
   for (const char *c = name; *c; c++)
     if (*c == '-')
@@ -1403,7 +1405,7 @@
   int cwidth = prop->width * wcw;
 
   // use same adjustments as in ->draw, see there
-  g.x += g.xOff ? cwidth - g.xOff >> 1 : 0;
+  g.x += g.xOff ? (cwidth - g.xOff) / 2 : 0;
   g.x += g.xOff ? 0 : cwidth;
 
   int w = g.width - g.x;
@@ -1500,7 +1502,7 @@
 
           // the xft font cell might differ from the terminal font cell,
           // in which case we use the average between the two.
-          ep->x += xOff ? cwidth - xOff >> 1 : 0;
+          ep->x += xOff ? (cwidth - xOff) / 2 : 0;
 
           // xft/freetype represent combining characters as characters with zero
           // width rendered over the previous character with some fonts, while
@@ -1745,7 +1747,7 @@
 bool
 rxvt_fontset::realize_font (int i)
 {
-  if (i < 0 || i >= fonts.size ())
+  if (i < 0 || (unsigned int)i >= fonts.size ())
     return false;
 
   if (fonts[i]->loaded)
diff -urN rxvt-unicode-9.31-orig/src/rxvtimg.C rxvt-unicode-9.31/src/rxvtimg.C
--- rxvt-unicode-9.31-orig/src/rxvtimg.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvtimg.C	2023-04-22 06:06:52 +0900
@@ -612,11 +612,11 @@
 
   // why the hell does XRenderSetPictureTransform want a writable matrix :(
   // that keeps us from just static const'ing this matrix.
-  XTransform h_double = {
-    0x08000, 0,     0,
-    0, 0x10000,     0,
-    0,     0, 0x10000
-  };
+  XTransform h_double = {{
+    {0x08000, 0,     0},
+    {0, 0x10000,     0},
+    {0,     0, 0x10000}
+  }};
 
   XRenderSetPictureFilter (cc.dpy, cc.src, "nearest", 0, 0);
   XRenderSetPictureTransform (cc.dpy, cc.src, &h_double);
@@ -646,11 +646,11 @@
     XDoubleToFixed (0), XDoubleToFixed (mul), XDoubleToFixed (add)
   };
 
-  XTransform h_halve = {
-    0x20000, 0,      0,
-    0, 0x10000,      0,
-    0,      0, 0x10000
-  };
+  XTransform h_halve = {{
+    {0x20000, 0,      0},
+    {0, 0x10000,      0},
+    {0,      0, 0x10000}
+  }};
 
   XRenderSetPictureFilter (cc.dpy, cc2.src, "nearest", 0, 0);
   XRenderSetPictureTransform (cc.dpy, cc2.src, &h_halve);
diff -urN rxvt-unicode-9.31-orig/src/rxvtperl.xs rxvt-unicode-9.31/src/rxvtperl.xs
--- rxvt-unicode-9.31-orig/src/rxvtperl.xs	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvtperl.xs	2023-04-22 06:06:52 +0900
@@ -1351,10 +1351,12 @@
         if (!XGrabPointer (THIS->dpy, THIS->vt, 0,
                            ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
                            mode, mode, None, GRAB_CURSOR, eventtime))
-          if (!XGrabKeyboard (THIS->dpy, THIS->vt, 0, mode, mode, eventtime))
-            THIS->perl.grabtime = eventtime;
-          else
-            XUngrabPointer (THIS->dpy, eventtime);
+          {
+            if (!XGrabKeyboard (THIS->dpy, THIS->vt, 0, mode, mode, eventtime))
+              THIS->perl.grabtime = eventtime;
+            else
+              XUngrabPointer (THIS->dpy, eventtime);
+          }
 
         RETVAL = !!THIS->perl.grabtime;
 }
@@ -1536,11 +1538,12 @@
             case 4: RETVAL = 0;                    break;
 #endif
             case 5: RETVAL = THIS->priv_modes;     break;
+            default: RETVAL = 0;                   break;
           }
         OUTPUT:
         RETVAL
 
-char *
+const char *
 rxvt_term::display_id ()
 	ALIAS:
            display_id = 0
@@ -1550,6 +1553,7 @@
           {
             case 0: RETVAL = THIS->display->id; break;
             case 1: RETVAL = THIS->locale;      break;
+            default: RETVAL = "";               break;
           }
         OUTPUT:
         RETVAL
@@ -2324,7 +2328,7 @@
 {
 	XWindowAttributes attr;
         XGetWindowAttributes (THIS->dpy, window, &attr);
-        XSelectInput (THIS->dpy, window, attr.your_event_mask | add_events & ~del_events);
+        XSelectInput (THIS->dpy, window, (attr.your_event_mask | add_events) & ~del_events);
 }
 
 void
@@ -2507,6 +2511,7 @@
             case 1: RETVAL = THIS->y; break;
             case 2: RETVAL = THIS->w; break;
             case 3: RETVAL = THIS->h; break;
+            default: RETVAL = 0;      break;
           }
 	OUTPUT:
         RETVAL
diff -urN rxvt-unicode-9.31-orig/src/rxvttoolkit.C rxvt-unicode-9.31/src/rxvttoolkit.C
--- rxvt-unicode-9.31-orig/src/rxvttoolkit.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvttoolkit.C	2023-04-22 06:06:52 +0900
@@ -584,7 +584,7 @@
     return;
 
   if (actual_type == XA_ATOM && actual_format == 32)
-    for (int i = 0; i < nitems; i++)
+    for (unsigned int i = 0; i < nitems; i++)
       if (XGetSelectionOwner (dpy, atoms[i]))
         {
           im_change_cb ();
@@ -736,7 +736,7 @@
 
 /////////////////////////////////////////////////////////////////////////////
 
-template class refcache<rxvt_display>;
+template struct refcache<rxvt_display>;
 refcache<rxvt_display> displays;
 
 /////////////////////////////////////////////////////////////////////////////
diff -urN rxvt-unicode-9.31-orig/src/rxvtutil.C rxvt-unicode-9.31/src/rxvtutil.C
--- rxvt-unicode-9.31-orig/src/rxvtutil.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/rxvtutil.C	2023-04-22 06:06:52 +0900
@@ -55,7 +55,7 @@
 void *
 rxvt_temp_buf (int len)
 {
-  if (len > temp_len)
+  if (len >= 0 && (unsigned int)len > temp_len)
     {
       free (temp_buf);
       temp_buf = malloc (len);
diff -urN rxvt-unicode-9.31-orig/src/screen.C rxvt-unicode-9.31/src/screen.C
--- rxvt-unicode-9.31-orig/src/screen.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/screen.C	2023-04-22 06:06:52 +0900
@@ -321,14 +321,12 @@
             {
               p = MOD (p - 1, prev_total_rows);
               assert (prev_row_buf [MOD (p, prev_total_rows)].t);
-              int plines = 1;
               int llen = prev_row_buf [MOD (p, prev_total_rows)].l;
 
               while (p != pend && prev_row_buf [MOD (p - 1, prev_total_rows)].is_longer ())
                 {
                   p = MOD (p - 1, prev_total_rows);
 
-                  plines++;
                   llen += prev_ncol;
                 }
 
@@ -835,33 +833,35 @@
       c = (unicode_t)*str++; // convert to rxvt-unicodes representation
 
       if (ecb_unlikely (c < 0x20))
-        if (c == C0_LF)
-          {
-            max_it (line->l, screen.cur.col);
+        {
+          if (c == C0_LF)
+            {
+              max_it (line->l, screen.cur.col);
 
-            screen.flags &= ~Screen_WrapNext;
+              screen.flags &= ~Screen_WrapNext;
 
-            if (screen.cur.row == screen.bscroll)
-              scr_scroll_text (screen.tscroll, screen.bscroll, 1);
-            else if (screen.cur.row < (nrow - 1))
-              row = ++screen.cur.row;
+              if (screen.cur.row == screen.bscroll)
+                scr_scroll_text (screen.tscroll, screen.bscroll, 1);
+              else if (screen.cur.row < (nrow - 1))
+                row = ++screen.cur.row;
 
-            line = &ROW(row);  /* _must_ refresh */
-            continue;
-          }
-        else if (c == C0_CR)
-          {
-            max_it (line->l, screen.cur.col);
+              line = &ROW(row);  /* _must_ refresh */
+              continue;
+            }
+          else if (c == C0_CR)
+            {
+              max_it (line->l, screen.cur.col);
 
-            screen.flags &= ~Screen_WrapNext;
-            screen.cur.col = 0;
-            continue;
-          }
-        else if (c == C0_HT)
-          {
-            scr_tab (1, true);
-            continue;
-          }
+              screen.flags &= ~Screen_WrapNext;
+              screen.cur.col = 0;
+              continue;
+            }
+          else if (c == C0_HT)
+            {
+              scr_tab (1, true);
+              continue;
+            }
+        }
 
       if (ecb_unlikely (
             checksel            /* see if we're writing within selection */
@@ -2141,6 +2141,14 @@
             scr_set_char_rend (ROW(screen.cur.row), cur_col, rend);
           }
       }
+    else
+      {
+        // suppress spurious uninitialized-variable warnings
+        cur_col = 0;
+        cursorwidth = 0;
+        ccol1 = Color_fg;
+        ccol2 = Color_fg;
+      }
 
     /* make sure no outline cursor is left around */
     if (ocrow != -1 && ocrow < nrow && oldcursor.col < ncol)
@@ -3021,7 +3029,7 @@
 /* what do we want: spaces/tabs are delimiters or cutchars or non-cutchars */
 #define DELIMIT_TEXT(x)		\
     (unicode::is_space (x) ? 2 : (x) <= 0xff && !!strchr (rs[Rs_cutchars], (x)))
-#define DELIMIT_REND(x)        1
+#define DELIMIT_REND(x)        ((void)(x), 1)
 
 void ecb_cold
 rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) noexcept
diff -urN rxvt-unicode-9.31-orig/src/scrollbar-next.C rxvt-unicode-9.31/src/scrollbar-next.C
--- rxvt-unicode-9.31-orig/src/scrollbar-next.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/scrollbar-next.C	2023-04-22 06:06:52 +0900
@@ -148,7 +148,9 @@
 scrollBar_t::init_next ()
 {
   XGCValues       gcvalue;
+#if 0
   rxvt_color      color;
+#endif
   Pixmap          stipple;
   unsigned long   light, dark;
 
diff -urN rxvt-unicode-9.31-orig/src/xdefaults.C rxvt-unicode-9.31/src/xdefaults.C
--- rxvt-unicode-9.31-orig/src/xdefaults.C	2023-04-22 06:14:36 +0900
+++ rxvt-unicode-9.31/src/xdefaults.C	2023-04-22 06:06:52 +0900
@@ -790,7 +790,7 @@
   /*
    * Query resources for options that affect us
    */
-  for (int entry = 0; entry < ecb_array_length (optList); entry++)
+  for (unsigned int entry = 0; entry < ecb_array_length (optList); entry++)
     {
       int s;
       const char *kw = optList[entry].kw;
