bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minor discrepancy in NCURSES_SIZE_T in configure


From: Thomas Dickey
Subject: Re: minor discrepancy in NCURSES_SIZE_T in configure
Date: Sat, 22 Jan 2022 13:47:45 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri, Jan 21, 2022 at 06:22:07AM +0000, wenzhang guo wrote:
> 
> Hi:
> 
> We have been using ncurses-5.7 and 6.2. It is a greatproduct.
> 
> However, we noticed a small issue that when a file is large (over29790
> lines), wmove() will return ERR.  This is due to inconsistent definitionof
> NCURSES_SIZE_T in file:  configure.  In the first place, it is
> NCURSES_SIZE_T=int , while second place is NCURSES_SIZE_T=short.I changed the
> second one to:  NCURSES_SIZE_T=int.  Problem solved.

The second one is "short" because of compatibility: the screen-size
"lines" and "cols" parameters in SVr4 terminfo are short.  X/Open
doesn't mention "short" for this type, but most(*) of the vendor-Unix's
inherited that (for compatibility...) and ncurses followed along with
that.

(*) Tru64 didn't exactly match that, with this definition:

        /* For performance reasons 'int' is much better than 'short' on Alpha. 
*/       
        typedef int _SHORT;

but we can regard that as a quirk.

The difference in ncurses dates to

20070310
        ...
        + add --enable-reentrant configure option for ongoing changes to
          implement a reentrant version of ncurses:

In the check-in comment, I did not mention the short/int change,
but the reason can be seen here:

20000429
        ...
        + add symbol NCURSES_SIZE_T to use rather than explicit 'short' for
          internal window and pad sizes.  Note that since this is visible in
          the WINDOW struct, it would be an ABI change to make this an 'int'
          (prompted by a question by Bastian Trompetter

That is, changing short/int would break binary compatibility,
but in the case of the reentrant code, binary compatibility was
already broken -- for _that_ configuration -- so it was an opportunity
to improve that particular configuration.

Conceivably, a new ABI (e.g., 7) could be set up to use "int"
(yet another configure option, etc), but as seen with ABI 6,
doing that takes a long time, and lots of work.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]