From b661daf1160a873609d70843999cd46eff25d1f0 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 28 Mar 2021 00:52:50 +0000 Subject: [PATCH] ncurses 6.2 - patch 20210327 + build-fixes for Solaris10 /bin/sh + fix some cppcheck warnings, mostly style, in ncurses test-programs, form and menu libraries. --- NEWS | 7 +- VERSION | 2 +- dist.mk | 4 +- doc/html/man/adacurses6-config.1.html | 2 +- doc/html/man/captoinfo.1m.html | 2 +- doc/html/man/clear.1.html | 2 +- doc/html/man/curs_extend.3x.html | 8 +- doc/html/man/curs_terminfo.3x.html | 154 +++++++++++++------------- doc/html/man/form.3x.html | 2 +- doc/html/man/infocmp.1m.html | 2 +- doc/html/man/infotocap.1m.html | 2 +- doc/html/man/menu.3x.html | 2 +- doc/html/man/ncurses.3x.html | 2 +- doc/html/man/ncurses6-config.1.html | 2 +- doc/html/man/panel.3x.html | 2 +- doc/html/man/tabs.1.html | 2 +- doc/html/man/terminfo.5.html | 2 +- doc/html/man/tic.1m.html | 2 +- doc/html/man/toe.1m.html | 2 +- doc/html/man/tput.1.html | 35 +++--- doc/html/man/tset.1.html | 2 +- form/fld_def.c | 10 +- form/frm_data.c | 9 +- form/frm_def.c | 8 +- form/frm_driver.c | 49 ++++---- form/frm_req_name.c | 7 +- form/fty_enum.c | 10 +- form/fty_generic.c | 6 +- form/fty_int.c | 18 +-- form/fty_ipv4.c | 6 +- form/fty_num.c | 20 ++-- menu/m_cursor.c | 10 +- menu/m_driver.c | 18 ++- menu/m_format.c | 7 +- menu/m_global.c | 44 ++++---- menu/m_item_top.c | 8 +- menu/m_item_val.c | 8 +- menu/m_post.c | 14 ++- menu/m_req_name.c | 7 +- misc/Makefile.in | 8 +- misc/gen-pkgconfig.in | 4 +- misc/ncurses-config.in | 4 +- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- package/ncursest.spec | 2 +- progs/dump_entry.c | 6 +- test/dup_field.c | 8 +- test/list_keys.c | 8 +- test/move_field.c | 13 +-- test/picsmap.c | 6 +- test/redraw.c | 10 +- test/savescreen.c | 34 +++--- test/test_add_wchstr.c | 9 +- test/test_sgr.c | 4 +- test/testcurs.c | 17 ++- test/view.c | 14 ++- test/xmas.c | 5 +- 61 files changed, 352 insertions(+), 319 deletions(-) diff --git a/NEWS b/NEWS index be1fdd8d..b754d3e6 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3645 2021/03/23 00:12:19 tom Exp $ +-- $Id: NEWS,v 1.3647 2021/03/27 23:40:15 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,11 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20210327 + + build-fixes for Solaris10 /bin/sh + + fix some cppcheck warnings, mostly style, in ncurses test-programs, + form and menu libraries. + 20210323 + add configure option --enable-stdnoreturn, making the _Noreturn keyword optional to ease transition (prompted by report by diff --git a/VERSION b/VERSION index 978d3690..06e2a2ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.2 20210323 +5:0:10 6.2 20210327 diff --git a/dist.mk b/dist.mk index d5313adb..ff3d7a90 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1406 2021/03/23 07:36:24 tom Exp $ +# $Id: dist.mk,v 1.1407 2021/03/27 09:43:25 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 2 -NCURSES_PATCH = 20210323 +NCURSES_PATCH = 20210327 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/doc/html/man/adacurses6-config.1.html b/doc/html/man/adacurses6-config.1.html index ec3b1b7b..22edfc0b 100644 --- a/doc/html/man/adacurses6-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -126,7 +126,7 @@

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index b4fe523e..e11d2dfb 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -199,7 +199,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index 15d8ad5c..93d937c6 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -150,7 +150,7 @@
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/curs_extend.3x.html b/doc/html/man/curs_extend.3x.html
index f1645a31..214e61bd 100644
--- a/doc/html/man/curs_extend.3x.html
+++ b/doc/html/man/curs_extend.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -65,7 +65,9 @@
 
 

curses_version

        Use curses_version to get the version number, including patch level  of
-       the library, e.g., 5.0.19991023
+       the library, prefixed by "ncurses", e.g.,
+
+              ncurses 5.0.19991023
 
 
 

use_extended_names

diff --git a/doc/html/man/curs_terminfo.3x.html b/doc/html/man/curs_terminfo.3x.html
index 3c8da425..efa8ab9f 100644
--- a/doc/html/man/curs_terminfo.3x.html
+++ b/doc/html/man/curs_terminfo.3x.html
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_terminfo.3x,v 1.72 2021/01/02 23:50:04 tom Exp @
+  * @Id: curs_terminfo.3x,v 1.74 2021/03/06 16:05:19 tom Exp @
   * ***************************************************************************
   * ***************************************************************************
   * ***************************************************************************
@@ -241,55 +241,62 @@
        o   Aside from the set_attributes (sgr) capability, most terminal capa-
            bilities require no more than one or two parameters.
 
+       o   Padding  information  is  ignored  by  tparm;  it is interpreted by
+           tputs.
+
+       o   The capability string is  null-terminated.   Use  "\200"  where  an
+           ASCII NUL is needed in the output.
+
        tiparm  is  a  newer  form of tparm which uses <stdarg.h> rather than a
        fixed-parameter list.  Its numeric parameters are integers (int) rather
        than longs.
 
 
 

Output Functions

-       The  tputs  routine  applies  padding information to the string str and
-       outputs it:
+       The  tputs  routine  applies padding information (i.e., by interpreting
+       marker embedded in the terminfo capability such as  "$<5>"  as  5  mil-
+       liseconds) to the string str and outputs it:
 
-       o   The str parameter must be a terminfo string variable or the  return
+       o   The  str parameter must be a terminfo string variable or the return
            value from tparm, tiparm, tgetstr, or tgoto.
 
-           The  tgetstr and tgoto functions are part of the termcap interface,
-           which happens to share this function name with the terminfo  inter-
+           The tgetstr and tgoto functions are part of the termcap  interface,
+           which  happens to share this function name with the terminfo inter-
            face.
 
        o   affcnt is the number of lines affected, or 1 if not applicable.
 
-       o   putc  is a putchar-like routine to which the characters are passed,
+       o   putc is a putchar-like routine to which the characters are  passed,
            one at a time.
 
-       The putp routine calls tputs(str, 1, putchar).  The output of putp  al-
+       The  putp routine calls tputs(str, 1, putchar).  The output of putp al-
        ways goes to stdout, rather than the filedes specified in setupterm.
 
-       The  vidputs  routine  displays the string on the terminal in the video
+       The vidputs routine displays the string on the terminal  in  the  video
        attribute mode attrs, which is any combination of the attributes listed
-       in  curses(3x).   The characters are passed to the putchar-like routine
+       in curses(3x).  The characters are passed to the  putchar-like  routine
        putc.
 
        The vidattr routine is like the vidputs routine, except that it outputs
        through putchar.
 
-       The  vid_attr  and vid_puts routines correspond to vidattr and vidputs,
-       respectively.  They use a set of arguments for representing  the  video
+       The vid_attr and vid_puts routines correspond to vidattr  and  vidputs,
+       respectively.   They  use a set of arguments for representing the video
        attributes plus color, i.e.,
 
        o   attrs of type attr_t for the attributes and
 
        o   pair of type short for the color-pair number.
 
-       The  vid_attr  and  vid_puts routines are designed to use the attribute
+       The vid_attr and vid_puts routines are designed to  use  the  attribute
        constants with the WA_ prefix.
 
-       X/Open Curses reserves the opts argument for future  use,  saying  that
-       applications  must provide a null pointer for that argument.  As an ex-
-       tension, this implementation allows opts to be used  as  a  pointer  to
+       X/Open  Curses  reserves  the opts argument for future use, saying that
+       applications must provide a null pointer for that argument.  As an  ex-
+       tension,  this  implementation  allows  opts to be used as a pointer to
        int, which overrides the pair (short) argument.
 
-       The  mvcur  routine  provides low-level cursor motion.  It takes effect
+       The mvcur routine provides low-level cursor motion.   It  takes  effect
        immediately (rather than at the next refresh).
 
        While putp and mvcur are low-level functions which do not use the high-
@@ -298,9 +305,9 @@
 
 
 

Terminal Capability Functions

-       The tigetflag, tigetnum and tigetstr routines return the value  of  the
-       capability  corresponding  to the terminfo capname passed to them, such
-       as xenl.  The capname for each capability is given in the table  column
+       The  tigetflag,  tigetnum and tigetstr routines return the value of the
+       capability corresponding to the terminfo capname passed to  them,  such
+       as  xenl.  The capname for each capability is given in the table column
        entitled capname code in the capabilities section of terminfo(5).
 
        These routines return special values to denote errors.
@@ -342,8 +349,8 @@
 
 
 

RETURN VALUE

-       Routines  that  return  an integer return ERR upon failure and OK (SVr4
-       only specifies "an integer value other than ERR") upon successful  com-
+       Routines that return an integer return ERR upon failure  and  OK  (SVr4
+       only  specifies "an integer value other than ERR") upon successful com-
        pletion, unless otherwise noted in the preceding routine descriptions.
 
        Routines that return pointers always return NULL on error.
@@ -365,25 +372,25 @@
                ditions are documented above.
 
           tputs
-               returns an error if the string parameter is null.  It does  not
-               detect  I/O errors: X/Open states that tputs ignores the return
+               returns  an error if the string parameter is null.  It does not
+               detect I/O errors: X/Open states that tputs ignores the  return
                value of the output function putc.
 
 
 

Compatibility macros

-       This implementation provides a few macros for compatibility  with  sys-
+       This  implementation  provides a few macros for compatibility with sys-
        tems  before  SVr4  (see  HISTORY).   Those  include  crmode,  fixterm,
        gettmode, nocrmode, resetterm, saveterm, and setterm.
 
-       In SVr4, those are found in <curses.h>, but  except  for  setterm,  are
+       In  SVr4,  those  are  found in <curses.h>, but except for setterm, are
        likewise macros.  The one function, setterm, is mentioned in the manual
-       page.  The manual page notes that the setterm routine was  replaced  by
+       page.   The  manual page notes that the setterm routine was replaced by
        setupterm, stating that the call:
 
              setupterm(term, 1, (int *)0)
 
        provides the same functionality as setterm(term), and is not recommend-
-       ed for new programs.  This implementation provides each of  those  sym-
+       ed  for  new programs.  This implementation provides each of those sym-
        bols as macros for BSD compatibility,
 
 
@@ -393,11 +400,10 @@
 
        Function    Description
        ------------------------------------------------------------
-
        fixterm     restore tty to "in curses" state
        gettmode    establish current tty modes
        mvcur       low level cursor motion
-       putp        utility function that uses tputs to send  char-
+       putp        utility  function that uses tputs to send char-
                    acters via putchar.
        resetterm   set tty modes to "out of curses" state
        resetty     reset tty flags to stored value
@@ -408,10 +414,10 @@
        tparm       instantiate a string expression with parameters
        tputs       apply padding information to a string
        vidattr     like vidputs, but outputs through putchar
-       vidputs     output  a string to put terminal in a specified
+       vidputs     output a string to put terminal in a  specified
                    video attribute mode
 
-       The programming manual also mentioned functions  provided  for  termcap
+       The  programming  manual  also mentioned functions provided for termcap
        compatibility (commenting that they "may go away at a later date"):
 
        Function   Description
@@ -424,10 +430,10 @@
        tputs      apply padding to capability, calling
                   a function to put characters
 
-       Early terminfo programs obtained capability values  from  the  TERMINAL
+       Early  terminfo  programs  obtained capability values from the TERMINAL
        structure initialized by setupterm.
 
-       SVr3  extended terminfo by adding functions to retrieve capability val-
+       SVr3 extended terminfo by adding functions to retrieve capability  val-
        ues (like the termcap interface), and reusing tgoto and tputs:
 
        Function    Description
@@ -436,7 +442,7 @@
        tigetnum    get numeric entry for given id
        tigetstr    get string entry for given id
 
-       SVr3 also replaced several of the SVr2 terminfo functions which had  no
+       SVr3  also replaced several of the SVr2 terminfo functions which had no
        counterpart in the termcap interface, documenting them as obsolete:
 
        Function    Replaced by
@@ -449,13 +455,13 @@
        saveterm    def_prog_mode
        setterm     setupterm
 
-       SVr3  kept  the  mvcur, vidattr and vidputs functions, along with putp,
-       tparm and tputs.  The latter were needed to support padding,  and  han-
-       dling  functions  such as vidattr (which used more than the two parame-
+       SVr3 kept the mvcur, vidattr and vidputs functions,  along  with  putp,
+       tparm  and  tputs.  The latter were needed to support padding, and han-
+       dling functions such as vidattr (which used more than the  two  parame-
        ters supported by tgoto).
 
-       SVr3 introduced the functions for switching between  terminal  descrip-
-       tions,  e.g.,  set_curterm.  The various global variables such as bool-
+       SVr3  introduced  the functions for switching between terminal descrip-
+       tions, e.g., set_curterm.  The various global variables such  as  bool-
        names were mentioned in the programming manual at this point.
 
        SVr4 added the vid_attr and vid_puts functions.
@@ -470,15 +476,15 @@
 

Legacy functions

        X/Open notes that vidattr and vidputs may be macros.
 
-       The function setterm is not described by X/Open and must be  considered
+       The  function setterm is not described by X/Open and must be considered
        non-portable.  All other functions are as described by X/Open.
 
 
 

Legacy data

-       setupterm  copies  the terminal name to the array ttytype.  This is not
+       setupterm copies the terminal name to the array ttytype.  This  is  not
        part of X/Open Curses, but is assumed by some applications.
 
-       Other implementions may not declare the capability name  arrays.   Some
+       Other  implementions  may not declare the capability name arrays.  Some
        provide them without declaring them.  X/Open does not specify them.
 
        Extended terminal capability names, e.g., as defined by tic -x, are not
@@ -486,14 +492,14 @@
 
 
 

Output buffering

-       Older versions of ncurses assumed that the file  descriptor  passed  to
+       Older  versions  of  ncurses assumed that the file descriptor passed to
        setupterm from initscr or newterm uses buffered I/O, and would write to
-       the corresponding stream.  In addition to the limitation that the  ter-
-       minal  was  left in block-buffered mode on exit (like System V curses),
-       it was problematic because ncurses did not  allow  a  reliable  way  to
+       the  corresponding stream.  In addition to the limitation that the ter-
+       minal was left in block-buffered mode on exit (like System  V  curses),
+       it  was  problematic  because  ncurses  did not allow a reliable way to
        cleanup on receiving SIGTSTP.
 
-       The  current version (ncurses6) uses output buffers managed directly by
+       The current version (ncurses6) uses output buffers managed directly  by
        ncurses.  Some of the low-level functions described in this manual page
        write to the standard output.  They are not signal-safe.  The high-lev-
        el functions in ncurses use alternate versions of these functions using
@@ -502,69 +508,69 @@
 
 

Function prototypes

        The X/Open Curses prototypes are based on the SVr4 curses header decla-
-       rations, which were defined at the same time the C language  was  first
+       rations,  which  were defined at the same time the C language was first
        standardized in the late 1980s.
 
-       o   X/Open  Curses  uses  const  less  effectively  than a later design
-           might, in some cases applying it needlessly to values  are  already
-           constant,  and  in most cases overlooking parameters which normally
-           would use const.  Using constant parameters for functions which  do
+       o   X/Open Curses uses const  less  effectively  than  a  later  design
+           might,  in  some cases applying it needlessly to values are already
+           constant, and in most cases overlooking parameters  which  normally
+           would  use const.  Using constant parameters for functions which do
            not use const may prevent the program from compiling.  On the other
            hand, writable strings are an obsolescent feature.
 
-           As an extension, this implementation can be  configured  to  change
-           the  function prototypes to use the const keyword.  The ncurses ABI
+           As  an  extension,  this implementation can be configured to change
+           the function prototypes to use the const keyword.  The ncurses  ABI
            6 enables this feature by default.
 
-       o   X/Open Curses prototypes tparm with a fixed number  of  parameters,
+       o   X/Open  Curses  prototypes tparm with a fixed number of parameters,
            rather than a variable argument list.
 
-           This  implementation uses a variable argument list, but can be con-
-           figured to use the  fixed-parameter  list.   Portable  applications
-           should  provide  9 parameters after the format; zeroes are fine for
+           This implementation uses a variable argument list, but can be  con-
+           figured  to  use  the  fixed-parameter list.  Portable applications
+           should provide 9 parameters after the format; zeroes are  fine  for
            this purpose.
 
-           In response to review comments by Thomas E. Dickey,  X/Open  Curses
+           In  response  to review comments by Thomas E. Dickey, X/Open Curses
            Issue 7 proposed the tiparm function in mid-2009.
 
 
 

Special TERM treatment

        If configured to use the terminal-driver, e.g., for the MinGW port,
 
-       o   setupterm  interprets  a missing/empty TERM variable as the special
+       o   setupterm interprets a missing/empty TERM variable as  the  special
            value "unknown".
 
-       o   setupterm allows explicit use of the the windows console driver  by
-           checking  if $TERM is set to "#win32con" or an abbreviation of that
+       o   setupterm  allows explicit use of the the windows console driver by
+           checking if $TERM is set to "#win32con" or an abbreviation of  that
            string.
 
 
 

Other portability issues

-       In System V Release 4, set_curterm has an int return type  and  returns
+       In  System  V Release 4, set_curterm has an int return type and returns
        OK or ERR.  We have chosen to implement the X/Open Curses semantics.
 
-       In  System  V  Release  4, the third argument of tputs has the type int
+       In System V Release 4, the third argument of tputs  has  the  type  int
        (*putc)(char).
 
-       At least one implementation of X/Open Curses (Solaris) returns a  value
-       other  than  OK/ERR from tputs.  That returns the length of the string,
+       At  least one implementation of X/Open Curses (Solaris) returns a value
+       other than OK/ERR from tputs.  That returns the length of  the  string,
        and does no error-checking.
 
-       X/Open notes that after calling mvcur, the curses state may  not  match
+       X/Open  notes  that after calling mvcur, the curses state may not match
        the actual terminal state, and that an application should touch and re-
        fresh the window before resuming normal curses calls.  Both ncurses and
-       System  V  Release 4 curses implement mvcur using the SCREEN data allo-
-       cated in either initscr or newterm.  So though it is  documented  as  a
-       terminfo  function, mvcur is really a curses function which is not well
+       System V Release 4 curses implement mvcur using the SCREEN  data  allo-
+       cated  in  either  initscr or newterm.  So though it is documented as a
+       terminfo function, mvcur is really a curses function which is not  well
        specified.
 
-       X/Open states that the old location must be given for mvcur.  This  im-
-       plementation  allows  the caller to use -1's for the old ordinates.  In
+       X/Open  states that the old location must be given for mvcur.  This im-
+       plementation allows the caller to use -1's for the old  ordinates.   In
        that case, the old location is unknown.
 
 
 

SEE ALSO

-       curses(3x),   curs_initscr(3x),   curs_kernel(3x),    curs_termcap(3x),
+       curses(3x),    curs_initscr(3x),   curs_kernel(3x),   curs_termcap(3x),
        curs_variables(3x), term_variables(3x), putc(3), terminfo(5)
 
 
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index 8b10dfa5..4a54b350 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -248,7 +248,7 @@
        curses(3x) and related pages whose names  begin  "form_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index c0ab7629..27ff2d79 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -514,7 +514,7 @@
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 

AUTHOR

diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index 2af6ac13..3de0ce64 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -91,7 +91,7 @@
 

SEE ALSO

        infocmp(1m), tic(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 

AUTHOR

diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index 6961b2b1..71e7fcf3 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -223,7 +223,7 @@
        curses(3x) and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index 64cc934b..a8ddba06 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -60,7 +60,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
        The  ncurses  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
diff --git a/doc/html/man/ncurses6-config.1.html b/doc/html/man/ncurses6-config.1.html
index e2678b28..a7ecd69c 100644
--- a/doc/html/man/ncurses6-config.1.html
+++ b/doc/html/man/ncurses6-config.1.html
@@ -113,7 +113,7 @@
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html
index df93d915..c1f088fe 100644
--- a/doc/html/man/panel.3x.html
+++ b/doc/html/man/panel.3x.html
@@ -281,7 +281,7 @@
 

SEE ALSO

        curses(3x), curs_variables(3x),
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 

AUTHOR

diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html
index 34dc416e..6bb91b0c 100644
--- a/doc/html/man/tabs.1.html
+++ b/doc/html/man/tabs.1.html
@@ -207,7 +207,7 @@
 

SEE ALSO

        infocmp(1m), tset(1), curses(3x), terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 0e5deb26..5aff20e5 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -106,7 +106,7 @@
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.
 
-       This manual describes ncurses version 6.2 (patch 20210109).
+       This manual describes ncurses version 6.2 (patch 20210327).
 
 
 

Terminfo Entry Syntax

diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
index cf74b772..a94fa807 100644
--- a/doc/html/man/tic.1m.html
+++ b/doc/html/man/tic.1m.html
@@ -461,7 +461,7 @@
        captoinfo(1m),   infocmp(1m),   infotocap(1m),   toe(1m),   curses(3x),
        term(5).  terminfo(5).  user_caps(5).
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 

AUTHOR

diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
index aa8d8b0e..febe3b5f 100644
--- a/doc/html/man/toe.1m.html
+++ b/doc/html/man/toe.1m.html
@@ -171,7 +171,7 @@
        captoinfo(1m),   infocmp(1m),   infotocap(1m),   tic(1m),   curses(3x),
        terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
index ffb131c6..73498f9b 100644
--- a/doc/html/man/tput.1.html
+++ b/doc/html/man/tput.1.html
@@ -1,7 +1,7 @@
 
 
 
@@ -483,37 +483,40 @@
            2010,  NetBSD's  tput  uses  terminfo names.  Before that, it (like
            FreeBSD) recognized termcap names.
 
+           Beginning in 2021, FreeBSD uses the ncurses  tput,  configured  for
+           both terminfo (tested first) and termcap (as a fallback).
+
        Because (apparently) all of the certified Unix systems support the full
-       set  of  capability names, the reasoning for documenting only a few may
+       set of capability names, the reasoning for documenting only a  few  may
        not be apparent.
 
-       o   X/Open Curses Issue 7 documents tput differently, with capname  and
+       o   X/Open  Curses Issue 7 documents tput differently, with capname and
            the other features used in this implementation.
 
-       o   That  is,  there  are  two standards for tput: POSIX (a subset) and
-           X/Open Curses (the full implementation).  POSIX documents a  subset
-           to  avoid  the  complication  of  including  X/Open  Curses and the
+       o   That is, there are two standards for tput:  POSIX  (a  subset)  and
+           X/Open  Curses (the full implementation).  POSIX documents a subset
+           to avoid the  complication  of  including  X/Open  Curses  and  the
            terminal capabilities database.
 
-       o   While it is certainly possible to  write  a  tput  program  without
-           using   curses,   none   of   the   systems  which  have  a  curses
-           implementation provide a tput utility which does  not  provide  the
+       o   While  it  is  certainly  possible  to write a tput program without
+           using  curses,  none  of  the   systems   which   have   a   curses
+           implementation  provide  a  tput utility which does not provide the
            capname feature.
 
        X/Open  Curses  Issue  7  (2009)  is  the  first  version  to  document
        utilities.  However that part of X/Open Curses does not follow existing
        practice (i.e., Unix features documented in SVID 3):
 
-       o   It  assigns exit code 4 to "invalid operand", which may be the same
-           as unknown capability.  For instance, the source code for  Solaris'
+       o   It assigns exit code 4 to "invalid operand", which may be the  same
+           as  unknown capability.  For instance, the source code for Solaris'
            xcurses uses the term "invalid" in this case.
 
-       o   It  assigns  exit  code  255  to  a  numeric  variable  that is not
+       o   It assigns exit  code  255  to  a  numeric  variable  that  is  not
            specified in the terminfo database.  That likely is a documentation
-           error,  confusing  the  -1  written  to  the standard output for an
+           error, confusing the -1 written  to  the  standard  output  for  an
            absent or cancelled numeric value versus an (unsigned) exit code.
 
-       The various Unix systems (AIX, HPUX, Solaris) use the  same  exit-codes
+       The  various  Unix systems (AIX, HPUX, Solaris) use the same exit-codes
        as ncurses.
 
        NetBSD curses documents different exit codes which do not correspond to
@@ -523,7 +526,7 @@
 

SEE ALSO

        clear(1), stty(1), tabs(1), tset(1), curs_termcap(3x), terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
index 471e0530..921815c0 100644
--- a/doc/html/man/tset.1.html
+++ b/doc/html/man/tset.1.html
@@ -391,7 +391,7 @@
        csh(1),   sh(1),   stty(1),   curs_terminfo(3x),  tty(4),  terminfo(5),
        ttys(5), environ(7)
 
-       This describes ncurses version 6.2 (patch 20210109).
+       This describes ncurses version 6.2 (patch 20210327).
 
 
 
diff --git a/form/fld_def.c b/form/fld_def.c
index de664eb5..51bdc648 100644
--- a/form/fld_def.c
+++ b/form/fld_def.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2014 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.43 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -86,14 +86,13 @@ FORM_EXPORT(TypeArgument *)
 _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
 {
   TypeArgument *res = (TypeArgument *)0;
-  TypeArgument *p;
 
   if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
     {
       assert(err != 0 && ap != (va_list *)0);
       if ((typ->status & _LINKED_TYPE) != 0)
 	{
-	  p = typeMalloc(TypeArgument, 1);
+	  TypeArgument *p = typeMalloc(TypeArgument, 1);
 
 	  if (p != 0)
 	    {
@@ -134,14 +133,13 @@ FORM_EXPORT(TypeArgument *)
 _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
 {
   TypeArgument *res = (TypeArgument *)0;
-  TypeArgument *p;
 
   if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
     {
       assert(err != 0 && argp != 0);
       if ((typ->status & _LINKED_TYPE) != 0)
 	{
-	  p = typeMalloc(TypeArgument, 1);
+	  TypeArgument *p = typeMalloc(TypeArgument, 1);
 
 	  if (p != 0)
 	    {
diff --git a/form/frm_data.c b/form/frm_data.c
index 0856afb8..30541922 100644
--- a/form/frm_data.c
+++ b/form/frm_data.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2013 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_data.c,v 1.19 2020/12/11 23:20:37 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.20 2021/03/27 23:49:58 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -150,12 +150,11 @@ data_ahead(const FORM *form)
 
       if (Single_Line_Field(field))
 	{
-	  int check_len;
-
 	  pos = form->begincol + field->cols;
 	  while (pos < field->dcols)
 	    {
-	      check_len = field->dcols - pos;
+	      int check_len = field->dcols - pos;
+
 	      if (check_len >= field->cols)
 		check_len = field->cols;
 	      cursor_moved = TRUE;
diff --git a/form/frm_def.c b/form/frm_def.c
index 89ae4ec3..a9f21f28 100644
--- a/form/frm_def.c
+++ b/form/frm_def.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.29 2020/12/11 23:47:16 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.30 2021/03/27 23:49:58 tom Exp $")
 
 /* this can't be readonly */
 static FORM default_form =
@@ -158,7 +158,6 @@ Connect_Fields(FORM *form, FIELD **fields)
 {
   int field_cnt, j;
   int page_nr;
-  int maximum_row_in_field, maximum_col_in_field;
   _PAGE *pg;
 
   T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
@@ -199,6 +198,9 @@ Connect_Fields(FORM *form, FIELD **fields)
      size of the form */
   for (j = 0; j < field_cnt; j++)
     {
+      int maximum_row_in_field;
+      int maximum_col_in_field;
+
       if (j == 0)
 	pg->pmin = (short)j;
       else
diff --git a/form/frm_driver.c b/form/frm_driver.c
index ad82643e..2e7b7b92 100644
--- a/form/frm_driver.c
+++ b/form/frm_driver.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.133 2020/12/12 00:36:42 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.134 2021/03/27 23:49:58 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -217,10 +217,10 @@ static FIELD_CELL myZEROS;
 static void
 check_pos(FORM *form, int lineno)
 {
-  int y, x;
-
   if (form && form->w)
     {
+      int y, x;
+
       getyx(form->w, y, x);
       if (y != form->currow || x != form->curcol)
 	{
@@ -265,10 +265,11 @@ static int
 wide_winsnstr(WINDOW *w, const cchar_t *s, int n)
 {
   int code = ERR;
-  int y, x;
 
   while (n-- > 0)
     {
+      int y, x;
+
       getyx(w, y, x);
       if ((code = wins_wch(w, s++)) != OK)
 	break;
@@ -511,7 +512,6 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
 {
   int width, height;
   int y, x;
-  int len;
   int row;
   FIELD_CELL *pBuffer;
 
@@ -525,6 +525,8 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
        row < height;
        row++, pBuffer += width)
     {
+      int len;
+
       if ((len = (int)(After_End_Of_Data(pBuffer, width) - pBuffer)) > 0)
 	{
 	  wmove(win, row, 0);
@@ -706,8 +708,6 @@ Field_Grown(FIELD *field, int amount)
 	   * realloc().
 	   */
 	  int i, j;
-	  FIELD_CELL *old_bp;
-	  FIELD_CELL *new_bp;
 
 	  result = TRUE;	/* allow sharing of recovery on failure */
 
@@ -715,8 +715,9 @@ Field_Grown(FIELD *field, int amount)
 	  field->buf = newbuf;
 	  for (i = 0; i <= field->nbuf; i++)
 	    {
-	      new_bp = Address_Of_Nth_Buffer(field, i);
-	      old_bp = oldbuf + i * (1 + old_buflen);
+	      FIELD_CELL *new_bp = Address_Of_Nth_Buffer(field, i);
+	      FIELD_CELL *old_bp = oldbuf + i * (1 + old_buflen);
+
 	      for (j = 0; j < old_buflen; ++j)
 		new_bp[j] = old_bp[j];
 	      while (j < new_buflen)
@@ -917,11 +918,12 @@ _nc_Refresh_Current_Field(FORM *form)
       else
 	{
 	  /* A multi-line, i.e. vertical scrolling field */
-	  int row_after_bottom, first_modified_row, first_unmodified_row;
+	  int first_modified_row, first_unmodified_row;
 
 	  if (field->drows > field->rows)
 	    {
-	      row_after_bottom = form->toprow + field->rows;
+	      int row_after_bottom = form->toprow + field->rows;
+
 	      if (form->currow < form->toprow)
 		{
 		  form->toprow = form->currow;
@@ -1005,7 +1007,6 @@ Perform_Justification(FIELD *field, WINDOW *win)
 {
   FIELD_CELL *bp;
   int len;
-  int col = 0;
 
   bp = (Field_Has_Option(field, O_NO_LEFT_STRIP)
 	? field->buf
@@ -1014,6 +1015,8 @@ Perform_Justification(FIELD *field, WINDOW *win)
 
   if (len > 0)
     {
+      int col = 0;
+
       assert(win && (field->drows == 1));
 
       if (field->cols - len >= 0)
@@ -1240,7 +1243,6 @@ Synchronize_Linked_Fields(FIELD *field)
 {
   FIELD *linked_field;
   int res = E_OK;
-  int syncres;
 
   if (!field)
     return (E_BAD_ARGUMENT);
@@ -1252,6 +1254,8 @@ Synchronize_Linked_Fields(FIELD *field)
        (linked_field != field) && (linked_field != 0);
        linked_field = linked_field->link)
     {
+      int syncres;
+
       if (((syncres = Synchronize_Field(linked_field)) != E_OK) &&
 	  (res == E_OK))
 	res = syncres;
@@ -1276,7 +1280,6 @@ _nc_Synchronize_Attributes(FIELD *field)
 {
   FORM *form;
   int res = E_OK;
-  WINDOW *formwin;
 
   T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field));
 
@@ -1303,7 +1306,8 @@ _nc_Synchronize_Attributes(FIELD *field)
 	    }
 	  else
 	    {
-	      formwin = Get_Form_Window(form);
+	      WINDOW *formwin = Get_Form_Window(form);
+
 	      copywin(form->w, formwin,
 		      0, 0,
 		      field->frow, field->fcol,
@@ -2422,7 +2426,6 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
   int datalen = (int)(After_End_Of_Data(bp, field->dcols) - bp);
   int freelen = field->dcols - datalen;
   int requiredlen = len + 1;
-  FIELD_CELL *split;
   int result = E_REQUEST_DENIED;
 
   if (freelen >= requiredlen)
@@ -2431,7 +2434,7 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
       myINSNSTR(form->w, txt, len);
       wmove(form->w, row, len);
       myINSNSTR(form->w, &myBLANK, 1);
-      return E_OK;
+      result = E_OK;
     }
   else
     {
@@ -2447,6 +2450,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
 
       if (row < (field->drows - 1))
 	{
+	  FIELD_CELL *split;
+
 	  split =
 	    After_Last_Whitespace_Character(bp,
 					    (int)(Get_Start_Of_Data(bp
@@ -2470,8 +2475,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
 	      return E_OK;
 	    }
 	}
-      return (result);
     }
+  return (result);
 }
 
 /*---------------------------------------------------------------------------
@@ -4474,14 +4479,13 @@ form_driver(FORM *form, int c)
 		}
 	      else if (wenclose(sub, event.y, event.x))
 		{		/* Inside the area we try to find the hit item */
-		  int i;
-
 		  ry = event.y;
 		  rx = event.x;
 		  if (wmouse_trafo(sub, &ry, &rx, FALSE))
 		    {
 		      int min_field = form->page[form->curpage].pmin;
 		      int max_field = form->page[form->curpage].pmax;
+		      int i;
 
 		      for (i = min_field; i <= max_field; ++i)
 			{
@@ -4676,14 +4680,13 @@ form_driver_w(FORM *form, int type, wchar_t c)
 		}
 	      else if (wenclose(sub, event.y, event.x))
 		{		/* Inside the area we try to find the hit item */
-		  int i;
-
 		  ry = event.y;
 		  rx = event.x;
 		  if (wmouse_trafo(sub, &ry, &rx, FALSE))
 		    {
 		      int min_field = form->page[form->curpage].pmin;
 		      int max_field = form->page[form->curpage].pmax;
+		      int i;
 
 		      for (i = min_field; i <= max_field; ++i)
 			{
diff --git a/form/frm_req_name.c b/form/frm_req_name.c
index 27d46966..a805faa7 100644
--- a/form/frm_req_name.c
+++ b/form/frm_req_name.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2015 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_req_name.c,v 1.21 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.22 2021/03/27 23:49:58 tom Exp $")
 
 #define DATA(s) { s }
 
@@ -150,12 +150,13 @@ form_request_by_name(const char *str)
      to run sequentially through it.
    */
   size_t i = 0;
-  char buf[16];			/* longest name is 10 chars */
 
   T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
 
   if (str != 0 && (i = strlen(str)) != 0)
     {
+      char buf[16];		/* longest name is 10 chars */
+
       if (i > sizeof(buf) - 2)
 	i = sizeof(buf) - 2;
       memcpy(buf, str, i);
diff --git a/form/fty_enum.c b/form/fty_enum.c
index 62242b56..c3a27ffa 100644
--- a/form/fty_enum.c
+++ b/form/fty_enum.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_enum.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.32 2021/03/27 23:49:53 tom Exp $")
 
 typedef struct
   {
@@ -77,7 +77,6 @@ Generic_Enum_Type(void *arg)
 	  int cnt = 0;
 	  char **kp = (char **)0;
 	  char **kwds = (char **)0;
-	  char **kptarget;
 	  int ccase, cunique;
 
 	  T((T_CREATE("enumARG %p"), (void *)argp));
@@ -96,6 +95,8 @@ Generic_Enum_Type(void *arg)
 
 	  if (cnt > 0)
 	    {
+	      char **kptarget;
+
 	      /* We copy the keywords, because we can't rely on the fact
 	         that the caller doesn't relocate or free the memory used
 	         for the keywords (maybe he has GC)
@@ -292,10 +293,11 @@ Check_Enum_Field(FIELD *field, const void *argp)
   bool unique = ((const enumARG *)argp)->checkunique;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s, *t, *p;
-  int res;
 
   while (kwds && (s = (*kwds++)))
     {
+      int res;
+
       if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
 	{
 	  p = t = s;		/* t is at least a partial match */
diff --git a/form/fty_generic.c b/form/fty_generic.c
index 3672d658..301c80a1 100644
--- a/form/fty_generic.c
+++ b/form/fty_generic.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2008-2012,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_generic.c,v 1.14 2020/12/12 17:27:44 tom Exp $")
+MODULE_ID("$Id: fty_generic.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
 
 /*
  * This is not a full implementation of a field type, but adds some
@@ -282,7 +282,7 @@ _nc_form_cursor(const FORM *form, int *pRow, int *pCol)
   int code = E_SYSTEM_ERROR;
   WINDOW *res = (WINDOW *)0;
 
-  if (!(form == 0 || pRow == 0 || pCol == 0))
+  if (form != 0 && pRow != 0 && pCol != 0)
     {
       *pRow = form->currow;
       *pCol = form->curcol;
diff --git a/form/fty_int.c b/form/fty_int.c
index d06ab8b6..70fe97d0 100644
--- a/form/fty_int.c
+++ b/form/fty_int.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_int.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.32 2021/03/27 23:49:58 tom Exp $")
 
 #if USE_WIDEC_SUPPORT
 #define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
@@ -170,11 +170,9 @@ Check_This_Field(FIELD *field, const void *argp)
   int prec = argi->precision;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s = (char *)bp;
-  long val;
-  char buf[100];
   bool result = FALSE;
 
-  while (*bp && *bp == ' ')
+  while (*bp == ' ')
     bp++;
   if (*bp)
     {
@@ -183,13 +181,14 @@ Check_This_Field(FIELD *field, const void *argp)
 #if USE_WIDEC_SUPPORT
       if (*bp)
 	{
-	  bool blank = FALSE;
 	  int len;
-	  int n;
 	  wchar_t *list = _nc_Widen_String((char *)bp, &len);
 
 	  if (list != 0)
 	    {
+	      bool blank = FALSE;
+	      int n;
+
 	      result = TRUE;
 	      for (n = 0; n < len; ++n)
 		{
@@ -227,7 +226,8 @@ Check_This_Field(FIELD *field, const void *argp)
 #endif
       if (result)
 	{
-	  val = atol(s);
+	  long val = atol(s);
+
 	  if (low < high)
 	    {
 	      if (val < low || val > high)
@@ -235,6 +235,8 @@ Check_This_Field(FIELD *field, const void *argp)
 	    }
 	  if (result)
 	    {
+	      char buf[100];
+
 	      _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
 			  "%.*ld", (prec > 0 ? prec : 0), val);
 	      set_field_buffer(field, 0, buf);
diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c
index d79683de..53f941b9 100644
--- a/form/fty_ipv4.c
+++ b/form/fty_ipv4.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2006,2009 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_ipv4.c,v 1.14 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,7 +53,7 @@ Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED)
 {
   char *bp = field_buffer(field, 0);
   int num = 0, len;
-  unsigned int d1, d2, d3, d4;
+  unsigned int d1 = 0, d2 = 0, d3 = 0, d4 = 0;
 
   if (isdigit(UChar(*bp)))	/* Must start with digit */
     {
diff --git a/form/fty_num.c b/form/fty_num.c
index 9eafaecb..34cef636 100644
--- a/form/fty_num.c
+++ b/form/fty_num.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2019-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_num.c,v 1.36 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.37 2021/03/27 23:49:58 tom Exp $")
 
 #if HAVE_LOCALE_H
 #include 
@@ -188,12 +188,10 @@ Check_This_Field(FIELD *field, const void *argp)
   int prec = argn->precision;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s = (char *)bp;
-  double val = 0.0;
   struct lconv *L = argn->L;
-  char buf[64];
   bool result = FALSE;
 
-  while (*bp && *bp == ' ')
+  while (*bp == ' ')
     bp++;
   if (*bp)
     {
@@ -202,14 +200,15 @@ Check_This_Field(FIELD *field, const void *argp)
 #if USE_WIDEC_SUPPORT
       if (*bp)
 	{
-	  bool blank = FALSE;
-	  int state = 0;
 	  int len;
-	  int n;
 	  wchar_t *list = _nc_Widen_String((char *)bp, &len);
 
 	  if (list != 0)
 	    {
+	      bool blank = FALSE;
+	      int state = 0;
+	      int n;
+
 	      result = TRUE;
 	      for (n = 0; n < len; ++n)
 		{
@@ -265,7 +264,8 @@ Check_This_Field(FIELD *field, const void *argp)
 #endif
       if (result)
 	{
-	  val = atof(s);
+	  double val = atof(s);
+
 	  if (low < high)
 	    {
 	      if (val < low || val > high)
@@ -273,6 +273,8 @@ Check_This_Field(FIELD *field, const void *argp)
 	    }
 	  if (result)
 	    {
+	      char buf[64];
+
 	      _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
 			  "%.*f", (prec > 0 ? prec : 0), val);
 	      set_field_buffer(field, 0, buf);
diff --git a/menu/m_cursor.c b/menu/m_cursor.c
index 8cf15ce5..b9b301d3 100644
--- a/menu/m_cursor.c
+++ b/menu/m_cursor.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.25 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -83,7 +83,6 @@ _nc_menu_cursor_pos(const MENU *menu, const ITEM *item, int *pY, int *pX)
 MENU_EXPORT(int)
 pos_menu_cursor(const MENU *menu)
 {
-  WINDOW *win, *sub;
   int x = 0, y = 0;
   int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
 
@@ -91,8 +90,9 @@ pos_menu_cursor(const MENU *menu)
 
   if (E_OK == err)
     {
-      win = Get_Menu_UserWin(menu);
-      sub = menu->usersub ? menu->usersub : win;
+      WINDOW *win = Get_Menu_UserWin(menu);
+      WINDOW *sub = menu->usersub ? menu->usersub : win;
+
       assert(win && sub);
 
       if ((menu->opt & O_SHOWMATCH) && (menu->pindex > 0))
diff --git a/menu/m_driver.c b/menu/m_driver.c
index b1d7c354..cf2ef2fe 100644
--- a/menu/m_driver.c
+++ b/menu/m_driver.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.36 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.37 2021/03/27 23:46:29 tom Exp $")
 
 /* Macros */
 
@@ -220,7 +220,7 @@ menu_driver(MENU *menu, int c)
 
   int result = E_OK;
   ITEM *item;
-  int my_top_row, rdiff;
+  int my_top_row;
 
   T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
 
@@ -239,6 +239,8 @@ menu_driver(MENU *menu, int c)
 
   if ((c > KEY_MAX) && (c <= MAX_MENU_COMMAND))
     {
+      int rdiff;
+
       if (!((c == REQ_BACK_PATTERN)
 	    || (c == REQ_NEXT_MATCH) || (c == REQ_PREV_MATCH)))
 	{
@@ -489,16 +491,20 @@ menu_driver(MENU *menu, int c)
 		    }
 		  else if (wenclose(sub, event.y, event.x))
 		    {		/* Inside the area we try to find the hit item */
-		      int i, x, y, err;
+		      int x, y;
 
 		      ry = event.y;
 		      rx = event.x;
 		      if (wmouse_trafo(sub, &ry, &rx, FALSE))
 			{
+			  int i;
+
 			  for (i = 0; i < menu->nitems; i++)
 			    {
-			      err = _nc_menu_cursor_pos(menu, menu->items[i],
-							&y, &x);
+			      int err = _nc_menu_cursor_pos(menu,
+							    menu->items[i],
+							    &y, &x);
+
 			      if (E_OK == err)
 				{
 				  if ((ry == y) &&
diff --git a/menu/m_format.c b/menu/m_format.c
index 848de0b2..65adfc6b 100644
--- a/menu/m_format.c
+++ b/menu/m_format.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.22 2021/03/27 23:46:29 tom Exp $")
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
@@ -59,7 +59,6 @@ MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
 MENU_EXPORT(int)
 set_menu_format(MENU *menu, int rows, int cols)
 {
-  int total_rows, total_cols;
 
   T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
 
@@ -68,6 +67,8 @@ set_menu_format(MENU *menu, int rows, int cols)
 
   if (menu)
     {
+      int total_rows, total_cols;
+
       if (menu->status & _POSTED)
 	RETURN(E_POSTED);
 
diff --git a/menu/m_global.c b/menu/m_global.c
index 2e521146..4ec08c52 100644
--- a/menu/m_global.c
+++ b/menu/m_global.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2014 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.32 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.33 2021/03/27 23:46:29 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -113,12 +113,12 @@ ComputeMaximum_NameDesc_Lengths(MENU *menu)
   unsigned MaximumNameLength = 0;
   unsigned MaximumDescriptionLength = 0;
   ITEM **items;
-  unsigned check;
 
   assert(menu && menu->items);
   for (items = menu->items; *items; items++)
     {
-      check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+      unsigned check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+
       if (check > MaximumNameLength)
 	MaximumNameLength = check;
 
@@ -174,11 +174,12 @@ ResetConnectionInfo(MENU *menu, ITEM **items)
 MENU_EXPORT(bool)
 _nc_Connect_Items(MENU *menu, ITEM **items)
 {
-  ITEM **item;
   unsigned int ItemCount = 0;
 
   if (menu && items)
     {
+      ITEM **item;
+
       for (item = items; *item; item++)
 	{
 	  if ((*item)->imenu)
@@ -292,23 +293,19 @@ static int
 calculate_actual_width(MENU *menu, bool name)
 {
   int width = 0;
-  int check = 0;
-  ITEM **items;
 
   assert(menu && menu->items);
 
   if (menu->items != 0)
     {
+      ITEM **items;
+
       for (items = menu->items; *items; items++)
 	{
-	  if (name)
-	    {
-	      check = _nc_Calculate_Text_Width(&((*items)->name));
-	    }
-	  else
-	    {
-	      check = _nc_Calculate_Text_Width(&((*items)->description));
-	    }
+	  int check = (name
+		       ? _nc_Calculate_Text_Width(&((*items)->name))
+		       : _nc_Calculate_Text_Width(&((*items)->description)));
+
 	  if (check > width)
 	    width = check;
 	}
@@ -381,7 +378,7 @@ _nc_Link_Items(MENU *menu)
 {
   if (menu && menu->items && *(menu->items))
     {
-      int i, j;
+      int i;
       ITEM *item;
       int Number_Of_Items = menu->nitems;
       int col = 0, row = 0;
@@ -444,6 +441,7 @@ _nc_Link_Items(MENU *menu)
       else
 	{
 	  int Number_Of_Rows = menu->rows;
+	  int j;
 
 	  for (j = 0; j < Number_Of_Items; j++)
 	    {
@@ -506,12 +504,12 @@ _nc_Link_Items(MENU *menu)
 MENU_EXPORT(void)
 _nc_Show_Menu(const MENU *menu)
 {
-  WINDOW *win;
-  int maxy, maxx;
-
   assert(menu);
   if ((menu->status & _POSTED) && !(menu->status & _IN_DRIVER))
     {
+      WINDOW *win;
+      int maxy, maxx;
+
       /* adjust the internal subwindow to start on the current top */
       assert(menu->sub);
       mvderwin(menu->sub, menu->spc_rows * menu->toprow, 0);
@@ -549,13 +547,13 @@ _nc_New_TopRow_and_CurrentItem(
 				int new_toprow,
 				ITEM *new_current_item)
 {
-  ITEM *cur_item;
-  bool mterm_called = FALSE;
-  bool iterm_called = FALSE;
-
   assert(menu);
   if (menu->status & _POSTED)
     {
+      ITEM *cur_item;
+      bool mterm_called = FALSE;
+      bool iterm_called = FALSE;
+
       if (new_current_item != menu->curitem)
 	{
 	  Call_Hook(menu, itemterm);
diff --git a/menu/m_item_top.c b/menu/m_item_top.c
index ee0d17b4..6518d545 100644
--- a/menu/m_item_top.c
+++ b/menu/m_item_top.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.15 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,8 +53,6 @@ MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
 MENU_EXPORT(int)
 set_top_row(MENU *menu, int row)
 {
-  ITEM *item;
-
   T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
 
   if (menu)
@@ -72,6 +70,8 @@ set_top_row(MENU *menu, int row)
 
   if (row != menu->toprow)
     {
+      ITEM *item;
+
       if (menu->status & _LINK_NEEDED)
 	_nc_Link_Items(menu);
 
diff --git a/menu/m_item_val.c b/menu/m_item_val.c
index a5c38e27..455987ff 100644
--- a/menu/m_item_val.c
+++ b/menu/m_item_val.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.19 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -56,12 +56,10 @@ MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
 MENU_EXPORT(int)
 set_item_value(ITEM *item, bool value)
 {
-  MENU *menu;
-
   T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
   if (item)
     {
-      menu = item->imenu;
+      MENU *menu = item->imenu;
 
       if ((!(item->opt & O_SELECTABLE)) ||
 	  (menu && (menu->opt & O_ONEVALUE)))
diff --git a/menu/m_post.c b/menu/m_post.c
index bfc63316..b4b1bc14 100644
--- a/menu/m_post.c
+++ b/menu/m_post.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.34 2020/12/12 00:38:14 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -58,7 +58,6 @@ _nc_Post_Item(const MENU *menu, const ITEM *item)
   int count = 0;
   bool isfore = FALSE, isback = FALSE, isgrey = FALSE;
   int name_len;
-  int desc_len;
 
   assert(menu->win);
 
@@ -132,6 +131,7 @@ _nc_Post_Item(const MENU *menu, const ITEM *item)
     {
       int m = menu->spc_desc / 2;
       int cy = -1, cx = -1;
+      int desc_len;
 
       for (ch = ' ', i = 0; i < menu->spc_desc; i++)
 	{
@@ -201,7 +201,7 @@ MENU_EXPORT(void)
 _nc_Draw_Menu(const MENU *menu)
 {
   ITEM *item = menu->items[0];
-  ITEM *lasthor, *lastvert;
+  ITEM *lastvert;
   ITEM *hitem;
   int y = 0;
   chtype s_bkgd;
@@ -217,6 +217,8 @@ _nc_Draw_Menu(const MENU *menu)
 
   do
     {
+      ITEM *lasthor;
+
       wmove(menu->win, y, 0);
 
       hitem = item;
@@ -283,7 +285,6 @@ post_menu(MENU *menu)
 
   if (menu->items && *(menu->items))
     {
-      int y;
       int h = 1 + menu->spc_rows * (menu->rows - 1);
 
       WINDOW *win = Get_Menu_Window(menu);
@@ -291,7 +292,8 @@ post_menu(MENU *menu)
 
       if ((menu->win = newpad(h, menu->width)))
 	{
-	  y = (maxy >= h) ? h : maxy;
+	  int y = (maxy >= h) ? h : maxy;
+
 	  if (y >= menu->height)
 	    y = menu->height;
 	  if (!(menu->sub = subpad(menu->win, y, menu->width, 0, 0)))
diff --git a/menu/m_req_name.c b/menu/m_req_name.c
index 7d1e7bf5..3bc09956 100644
--- a/menu/m_req_name.c
+++ b/menu/m_req_name.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2015 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_req_name.c,v 1.25 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
 
 #define DATA(s) { s }
 
@@ -103,12 +103,13 @@ menu_request_by_name(const char *str)
      to run sequentially through it.
    */
   size_t i = 0;
-  char buf[16];
 
   T((T_CALLED("menu_request_by_name(%s)"), _nc_visbuf(str)));
 
   if (str != 0 && (i = strlen(str)) != 0)
     {
+      char buf[16];
+
       if (i > sizeof(buf) - 2)
 	i = sizeof(buf) - 2;
       memcpy(buf, str, i);
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 3999a4e9..6060067e 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.74 2021/01/23 20:42:08 tom Exp $
+# $Id: Makefile.in,v 1.75 2021/03/27 20:39:59 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
@@ -132,7 +132,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config
 @MAKE_PC_FILES@install \
 @MAKE_PC_FILES@install.libs :: pc-files
 @MAKE_PC_FILES@	@$(SHELL) -c 'case "x$(DESTDIR)$(PKG_CONFIG_LIBDIR)" in \
-@MAKE_PC_FILES@		(x/*) \
+@MAKE_PC_FILES@		x/*) \
 @MAKE_PC_FILES@			mkdir -p $(DESTDIR)$(PKG_CONFIG_LIBDIR); \
 @MAKE_PC_FILES@			for name in $(PC_FILES); do \
 @MAKE_PC_FILES@				test -f $$name || continue; \
@@ -140,7 +140,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config
 @MAKE_PC_FILES@				$(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; \
 @MAKE_PC_FILES@			done \
 @MAKE_PC_FILES@			;; \
-@MAKE_PC_FILES@		(*) \
+@MAKE_PC_FILES@		*) \
 @MAKE_PC_FILES@			echo "...skip actual install: no destination was given" ; \
 @MAKE_PC_FILES@			;; \
 @MAKE_PC_FILES@		esac'
@@ -177,7 +177,7 @@ uninstall.data :
 uninstall.libs :
 	-rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
 @MAKE_PC_FILES@	@$(SHELL) -c 'case x$(DESTDIR)$(PKG_CONFIG_LIBDIR) in \
-@MAKE_PC_FILES@	(x/*) \
+@MAKE_PC_FILES@	x/*) \
 @MAKE_PC_FILES@		for name in $(PC_FILES); do \
 @MAKE_PC_FILES@			test -f $$name || continue; \
 @MAKE_PC_FILES@			echo uninstalling $$name; \
diff --git a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in
index 5a71ab02..1fc0a020 100644
--- a/misc/gen-pkgconfig.in
+++ b/misc/gen-pkgconfig.in
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.49 2021/01/24 00:35:28 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.50 2021/03/27 20:26:16 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2009-2015,2018 Free Software Foundation, Inc.                    #
@@ -96,7 +96,7 @@ do
 		continue
 		;;
 	-L*)
-		lib_check=${opt##-L} 
+		lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
 		[ -d "$lib_check" ] || continue
 		case "$lib_check" in
 		@LD_SEARCHPATH@) # skip standard libdir
diff --git a/misc/ncurses-config.in b/misc/ncurses-config.in
index eae39a51..f4fd4101 100644
--- a/misc/ncurses-config.in
+++ b/misc/ncurses-config.in
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: ncurses-config.in,v 1.46 2021/01/23 23:47:46 tom Exp $
+# $Id: ncurses-config.in,v 1.47 2021/03/27 20:26:04 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2006-2015,2017 Free Software Foundation, Inc.                    #
@@ -111,7 +111,7 @@ do
 		continue
 		;;
 	-L*)
-		lib_check=${opt##-L} 
+		lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
 		[ -d "$lib_check" ] || continue
 		case "$lib_check" in
 		@LD_SEARCHPATH@) # skip standard libdir
diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog
index c9371a99..beee9ddd 100644
--- a/package/debian-mingw/changelog
+++ b/package/debian-mingw/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey   Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog
index c9371a99..beee9ddd 100644
--- a/package/debian-mingw64/changelog
+++ b/package/debian-mingw64/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey   Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian/changelog b/package/debian/changelog
index fe1bd711..74094970 100644
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey   Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi
index bbe68f5f..9f01c9cb 100644
--- a/package/mingw-ncurses.nsi
+++ b/package/mingw-ncurses.nsi
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.449 2021/03/23 07:36:24 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.450 2021/03/27 09:43:25 tom Exp $
 
 ; TODO add examples
 ; TODO bump ABI to 6
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"
 !define VERSION_MINOR "2"
 !define VERSION_YYYY  "2021"
-!define VERSION_MMDD  "0323"
+!define VERSION_MMDD  "0327"
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
 
 !define MY_ABI   "5"
diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec
index e3bd1d4e..d92819d5 100644
--- a/package/mingw-ncurses.spec
+++ b/package/mingw-ncurses.spec
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncurses.spec b/package/ncurses.spec
index 9c689985..ac73b8aa 100644
--- a/package/ncurses.spec
+++ b/package/ncurses.spec
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncursest.spec b/package/ncursest.spec
index 8b82bae8..0b931621 100644
--- a/package/ncursest.spec
+++ b/package/ncursest.spec
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/progs/dump_entry.c b/progs/dump_entry.c
index f38e8c71..9472e5f5 100644
--- a/progs/dump_entry.c
+++ b/progs/dump_entry.c
@@ -40,7 +40,7 @@
 #include "termsort.c"		/* this C file is generated */
 #include 	/* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.182 2021/03/20 16:08:32 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.183 2021/03/28 00:09:49 tom Exp $")
 
 #define DISCARD(string) string = ABSENT_STRING
 #define PRINTF (void) printf
@@ -526,13 +526,13 @@ fill_spaces(const char *src)
     size_t size = strlen(fill);
     char *result = 0;
     int pass;
-    int s, d;
+    size_t s, d;
     for (pass = 0; pass < 2; ++pass) {
 	for (s = d = 0; src[s] != '\0'; ++s) {
 	    if (src[s] == ' ') {
 		if (pass) {
 		    _nc_STRCPY(&result[d], fill, need + 1 - d);
-		    d += (int) size;
+		    d += size;
 		} else {
 		    need += size;
 		}
diff --git a/test/dup_field.c b/test/dup_field.c
index 5ca67f0b..eb87c90c 100644
--- a/test/dup_field.c
+++ b/test/dup_field.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: dup_field.c,v 1.1 2020/03/21 19:28:36 tom Exp $
+ * $Id: dup_field.c,v 1.2 2021/03/27 23:41:57 tom Exp $
  *
  * Demonstrate move_field().
  */
@@ -42,7 +42,6 @@
 
 static char empty[] = "";
 static FIELD *all_fields[100];
-
 /* *INDENT-OFF* */
 static struct {
     int code;
@@ -213,7 +212,6 @@ my_edit_field(FORM *form, int *result)
     int status;
     FIELD *before;
     unsigned n;
-    int length;
     int before_row;
     int before_col;
     int before_off = offset_in_field(form);
@@ -239,8 +237,8 @@ my_edit_field(FORM *form, int *result)
 
     if (status == E_OK) {
 	bool modified = TRUE;
+	int length = buffer_length(before);
 
-	length = buffer_length(before);
 	if (length < before_off)
 	    length = before_off;
 	switch (*result) {
diff --git a/test/list_keys.c b/test/list_keys.c
index cdad60e9..e3077de4 100644
--- a/test/list_keys.c
+++ b/test/list_keys.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2016,2017 Free Software Foundation, Inc.                       *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: list_keys.c,v 1.26 2020/02/02 23:34:34 tom Exp $
+ * $Id: list_keys.c,v 1.27 2021/03/27 23:41:21 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -240,7 +240,7 @@ modified_key(const char *name)
 	map |= (bit1 << 1) | (bit2 >> 1);
 	_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
 		    "%sF%d", modifiers[map][(unsigned) f_opt], 1 + key);
-    } else if (sscanf(name, "k%[A-Z]%d%c", buffer, &value, &chr) == 2 &&
+    } else if (sscanf(name, "k%80[A-Z]%d%c", buffer, &value, &chr) == 2 &&
 	       (value > 1 &&
 		value <= 8) &&
 	       (!strcmp(buffer, "UP") ||
@@ -255,7 +255,7 @@ modified_key(const char *name)
 		!strcmp(buffer, "PRV"))) {
 	_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
 		    "%sk%s", modifiers[value - 1][(unsigned) f_opt], buffer);
-    } else if (sscanf(name, "k%[A-Z]%c", buffer, &chr) == 1 &&
+    } else if (sscanf(name, "k%80[A-Z]%c", buffer, &chr) == 1 &&
 	       (!strcmp(buffer, "UP") ||
 		!strcmp(buffer, "DN"))) {
 	_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
diff --git a/test/move_field.c b/test/move_field.c
index 8344c56f..5e7fc82e 100644
--- a/test/move_field.c
+++ b/test/move_field.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: move_field.c,v 1.7 2020/05/09 12:52:00 tom Exp $
+ * $Id: move_field.c,v 1.8 2021/03/27 23:41:57 tom Exp $
  *
  * Demonstrate move_field().
  */
@@ -41,7 +41,7 @@
 #ifdef HAVE_NETBSD_FORM_H
 #define form_field_row(field) (field)->form_row
 #define form_field_col(field) (field)->form_col
-#else	/* e.g., SVr4, ncurses */
+#else /* e.g., SVr4, ncurses */
 #define form_field_row(field) (field)->frow
 #define form_field_col(field) (field)->fcol
 #endif
@@ -51,7 +51,6 @@
 
 static char empty[] = "";
 static FIELD *all_fields[100];
-
 /* *INDENT-OFF* */
 static struct {
     int code;
@@ -196,7 +195,6 @@ my_edit_field(FORM *form, int *result)
     int status;
     FIELD *before;
     unsigned n;
-    int length;
     int before_row;
     int before_col;
     int before_off = offset_in_field(form);
@@ -222,8 +220,8 @@ my_edit_field(FORM *form, int *result)
 
     if (status == E_OK) {
 	bool modified = TRUE;
+	int length = buffer_length(before);
 
-	length = buffer_length(before);
 	if (length < before_off)
 	    length = before_off;
 	switch (*result) {
@@ -316,10 +314,10 @@ do_demo(FORM *form)
 	size_t needed = (size_t) count;
 	FIELD **old_fields = copy_fields(form_fields(form), needed);
 	FIELD **new_fields = copy_fields(form_fields(form), needed);
-	int ch;
 
 	if (old_fields != NULL && new_fields != NULL) {
 	    bool found = FALSE;
+	    int ch;
 
 	    /* TODO: move the label too, in parallel with the editing field */
 
@@ -338,7 +336,6 @@ do_demo(FORM *form)
 		getyx(stdscr, currow, curcol);
 
 		show_status(form, my_field);
-		ch = '?';
 		while ((ch = wgetch(form_win(form))) != DO_DEMO) {
 		    int field_y = form_field_row(my_field);
 		    int field_x = form_field_col(my_field);
diff --git a/test/picsmap.c b/test/picsmap.c
index ecd70fbe..1aaa5af9 100644
--- a/test/picsmap.c
+++ b/test/picsmap.c
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.136 2021/03/20 16:08:22 tom Exp $
+ * $Id: picsmap.c,v 1.137 2021/03/27 22:52:16 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -1015,7 +1015,7 @@ parse_xbm(char **data)
 	case 0:
 	case 1:
 	case 2:
-	    if (sscanf(s, "#define %s %d%c", buf, &num, &ch) >= 2) {
+	    if (sscanf(s, "#define %1024s %d%c", buf, &num, &ch) >= 2) {
 		if ((t = strstr(buf, "_width")) != 0) {
 		    state |= 1;
 		    result->wide = (short) bytes_of(num);
@@ -1036,7 +1036,7 @@ parse_xbm(char **data)
 	    }
 	    break;
 	case 3:
-	    if (sscanf(s, "static char %[^_ ]_bits[]%c", buf, &ch) >= 1) {
+	    if (sscanf(s, "static char %1024[^_ ]_bits[]%c", buf, &ch) >= 1) {
 		if (strcmp(result->name, buf)) {
 		    goto finish;
 		}
diff --git a/test/redraw.c b/test/redraw.c
index 569c2769..1a2a29c7 100644
--- a/test/redraw.c
+++ b/test/redraw.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: redraw.c,v 1.11 2020/02/02 23:34:34 tom Exp $
+ * $Id: redraw.c,v 1.12 2021/03/27 23:41:21 tom Exp $
  *
  * Demonstrate the redrawwin() and wredrawln() functions.
  * Thomas Dickey - 2006/11/4
@@ -82,7 +82,6 @@ test_redraw(WINDOW *win)
     WINDOW *win1;
     WINDOW *win2;
     bool done = FALSE;
-    int ch, y, x;
     int max_y, max_x;
     int beg_y, beg_x;
 
@@ -92,8 +91,11 @@ test_redraw(WINDOW *win)
     keypad(win, TRUE);
     getmaxyx(win, max_y, max_x);
     getbegyx(win, beg_y, beg_x);
+
     while (!done) {
-	ch = wgetch(win);
+	int ch = wgetch(win);
+	int y, x;
+
 	getyx(win, y, x);
 	switch (ch) {
 	case 'q':
diff --git a/test/savescreen.c b/test/savescreen.c
index da00d753..4c767a52 100644
--- a/test/savescreen.c
+++ b/test/savescreen.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2006-2017,2018 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: savescreen.c,v 1.57 2020/02/02 23:34:34 tom Exp $
+ * $Id: savescreen.c,v 1.58 2021/03/27 23:41:21 tom Exp $
  *
  * Demonstrate save/restore functions from the curses library.
  * Thomas Dickey - 2007/7/14
@@ -86,9 +86,9 @@ setup_next(void)
 static void
 cleanup(char *files[])
 {
-    int n;
-
     if (!keep_dumps) {
+	int n;
+
 	for (n = 0; files[n] != 0; ++n) {
 	    unlink(files[n]);
 	}
@@ -169,7 +169,6 @@ dump_screen(char **files, int color, int which, int last, bool use_colors)
 {
 #if USE_WIDEC_SUPPORT
     cchar_t mycc;
-    int myxx;
 #endif
     char *filename = files[which];
     bool dumped = FALSE;
@@ -198,7 +197,7 @@ dump_screen(char **files, int color, int which, int last, bool use_colors)
 		    wmove(stdscr, cy, cx);
 #if USE_WIDEC_SUPPORT
 		    if (win_wch(curscr, &mycc) != ERR) {
-			myxx = wcwidth(BaseChar(mycc));
+			int myxx = wcwidth(BaseChar(mycc));
 			if (myxx > 0) {
 			    wadd_wchnstr(stdscr, &mycc, 1);
 			    cx += (myxx - 1);
@@ -285,14 +284,9 @@ main(int argc, char *argv[])
     char **files;
     char *fill_by = 0;
 #if USE_WIDEC_SUPPORT
-    int r, g, b;
-    int cube = 0;
-    int cube0 = 16;
-    int cube1;
     cchar_t mycc;
     static const wchar_t mywc[2] =
     {L'#', 0};
-    bool using_rgb = FALSE;
 #endif
 
     setlocale(LC_ALL, "");
@@ -332,6 +326,9 @@ main(int argc, char *argv[])
     curs_set(0);
 
     if (has_colors() && (start_color() == OK) && COLORS >= MAX_ANSI) {
+#if USE_WIDEC_SUPPORT
+	bool using_rgb = FALSE;
+#endif
 	static const struct {
 	    int fg, bg;
 	} table[MAX_ANSI] = {
@@ -378,13 +375,13 @@ main(int argc, char *argv[])
 		    int r_delta = (r_max / cols);
 		    int g_delta = (g_max / cols);
 		    int row = 0;
+		    int b = 0;
 
-		    b = 0;
 		    using_rgb = TRUE;
 		    while (row++ < rows) {
 			int col = 0;
-			r = 0;
-			g = g_max;
+			int r = 0;
+			int g = g_max;
 			while (col++ < cols) {
 			    int color = (((r * (g_max + 1)) + g) * (b_max + 1)
 					 + b + MAX_ANSI);
@@ -404,6 +401,9 @@ main(int argc, char *argv[])
 #endif
 	}
 	if ((fill_by == 0) && !replaying) {
+#if USE_WIDEC_SUPPORT
+	    int cube = 0;
+#endif
 	    /*
 	     * Originally (before wide-characters) ncurses supported 16 colors.
 	     */
@@ -428,8 +428,9 @@ main(int argc, char *argv[])
 		cube = 6;
 	    }
 	    if (cube != 0) {
-		cube0 = 16;
-		cube1 = cube0 + (cube * cube * cube);
+		int r, g, b;
+		int cube0 = 16;
+		int cube1 = cube0 + (cube * cube * cube);
 
 		addch('\n');
 		printw("Color cube, %dx%dx%d:\n", cube, cube, cube);
@@ -460,7 +461,6 @@ main(int argc, char *argv[])
 		int cols = COLS - 1;
 		int row = 0;
 
-		b = 0;
 		pair = MAX_ANSI;
 		while (row++ < rows) {
 		    int col = 0;
diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c
index e2c8b667..a7ada59e 100644
--- a/test/test_add_wchstr.c
+++ b/test/test_add_wchstr.c
@@ -1,6 +1,6 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                               *
- * Copyright 2009-2016,2017 Free Software Foundation, Inc.                       *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2009-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_add_wchstr.c,v 1.27 2020/02/02 23:34:34 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $
  *
  * Demonstrate the waddwchstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -132,9 +132,10 @@ ChWLen(const wchar_t *source)
     if (!pass_ctls) {
 	size_t adjust = 0;
 	size_t n;
-	const char *s;
 
 	for (n = 0; n < result; ++n) {
+	    const char *s;
+
 	    if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
 		adjust += (strlen(s) - 1);
 	    }
diff --git a/test/test_sgr.c b/test/test_sgr.c
index 3d72e990..33564adb 100644
--- a/test/test_sgr.c
+++ b/test/test_sgr.c
@@ -30,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: test_sgr.c,v 1.16 2021/03/20 16:04:31 tom Exp $
+ * $Id: test_sgr.c,v 1.17 2021/03/27 22:43:36 tom Exp $
  *
  * A simple demo of the sgr/sgr0 terminal capabilities.
  */
@@ -116,7 +116,7 @@ next_dbitem(void)
 	    db_item++;
 	}
     }
-    printf("** %s\n", result);
+    printf("** %s\n", result ? result : "");
     return result;
 }
 
diff --git a/test/testcurs.c b/test/testcurs.c
index f9762b0b..2e014159 100644
--- a/test/testcurs.c
+++ b/test/testcurs.c
@@ -6,7 +6,7 @@
  *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
  *                  PDCurses or under Unix System V, R4
  *
- * $Id: testcurs.c,v 1.55 2019/12/14 23:25:29 tom Exp $
+ * $Id: testcurs.c,v 1.56 2021/03/27 22:39:50 tom Exp $
  */
 
 #include 
@@ -160,7 +160,7 @@ inputTest(WINDOW *win)
 {
     int answered;
     int repeat;
-    int w, h, bx, by, sw, sh, i, c, num;
+    int w, h, bx, by, sw, sh, i, num;
     char buffer[80];
     WINDOW *subWin;
     wclear(win);
@@ -238,6 +238,8 @@ inputTest(WINDOW *win)
 #endif
 
     for (;;) {
+	int c;
+
 	wmove(win, 3, 5);
 	c = wgetch(win);
 	wclrtobot(win);
@@ -355,7 +357,6 @@ inputTest(WINDOW *win)
 static void
 outputTest(WINDOW *win)
 {
-    WINDOW *win1;
     char Buffer[80];
     chtype ch;
     int by, bx;
@@ -395,7 +396,7 @@ outputTest(WINDOW *win)
 	MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
 	Continue(win);
     } else {
-	win1 = newwin(10, 50, 14, 25);
+	WINDOW *win1 = newwin(10, 50, 14, 25);
 	if (win1 == NULL) {
 	    endwin();
 	    return;
@@ -589,9 +590,11 @@ resizeTest(WINDOW *dummy GCC_UNUSED)
 static void
 padTest(WINDOW *dummy GCC_UNUSED)
 {
-    WINDOW *pad, *spad;
+    WINDOW *pad;
 
     if ((pad = newpad(50, 100)) != 0) {
+	WINDOW *spad;
+
 	wattron(pad, A_REVERSE);
 	MvWAddStr(pad, 5, 2, "This is a new pad");
 	(void) wattrset(pad, A_NORMAL);
@@ -679,7 +682,6 @@ main(
 	char *argv[]GCC_UNUSED)
 {
     WINDOW *win;
-    int key;
     int old_option = (-1);
     int new_option = 0;
     bool quit = FALSE;
@@ -695,7 +697,10 @@ main(
 
     erase();
     display_menu(old_option, new_option);
+
     for (;;) {
+	int key;
+
 #ifdef A_COLOR
 	if (has_colors()) {
 	    init_pair(1, COLOR_WHITE, COLOR_BLUE);
diff --git a/test/view.c b/test/view.c
index 6beadc26..30a9c7ff 100644
--- a/test/view.c
+++ b/test/view.c
@@ -52,7 +52,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.139 2021/03/20 16:04:20 tom Exp $
+ * $Id: view.c,v 1.140 2021/03/27 22:42:22 tom Exp $
  */
 
 #include 
@@ -92,12 +92,10 @@ static int
 ch_len(NCURSES_CH_T *src)
 {
     int result = 0;
-#if USE_WIDEC_SUPPORT
-    int count;
-#endif
 
 #if USE_WIDEC_SUPPORT
     for (;;) {
+	int count;
 	TEST_CCHAR(src, count, {
 	    int len = wcwidth(test_wch[0]);
 	    result += (len > 0) ? len : 1;
@@ -136,7 +134,6 @@ show_all(const char *tag)
     int i;
     int digits;
     char temp[BUFSIZ];
-    NCURSES_CH_T *s;
     time_t this_time;
 
     for (digits = 1, i = num_lines; i > 0; i /= 10) {
@@ -161,8 +158,10 @@ show_all(const char *tag)
 
     scrollok(stdscr, FALSE);	/* prevent screen from moving */
     for (i = 1; i < LINES; i++) {
+	NCURSES_CH_T *s;
 	int len;
 	int actual = (int) (lptr + i - vec_lines);
+
 	if (actual > num_lines) {
 	    if (i < LINES - 1) {
 		int y, x;
@@ -189,8 +188,11 @@ show_all(const char *tag)
 	     */
 	    {
 		int j;
-		int width = 1, count;
+		int width = 1;
+
 		for (j = actual = 0; j < shift; ++j) {
+		    int count;
+
 		    TEST_CCHAR(s + j, count, {
 			width = wcwidth(test_wch[0]);
 		    }
diff --git a/test/xmas.c b/test/xmas.c
index e157a7cb..678c9e17 100644
--- a/test/xmas.c
+++ b/test/xmas.c
@@ -92,7 +92,7 @@
 /******************************************************************************/
 
 /*
- * $Id: xmas.c,v 1.35 2021/03/20 16:15:31 tom Exp $
+ * $Id: xmas.c,v 1.36 2021/03/27 22:40:53 tom Exp $
  */
 #include 
 
@@ -500,9 +500,6 @@ reindeer(void)
     y_pos = 0;
 
     for (x_pos = 70; x_pos > 62; x_pos--) {
-	if (x_pos < 62) {
-	    y_pos = 1;
-	}
 	for (looper = 0; looper < 4; looper++) {
 	    MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
 	    wrefresh(dotdeer0);
-- 
2.44.0