Source-Changes archive

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

CVS commit: src/lib/libedit



Module Name:    src
Committed By:   christos
Date:           Sun Feb 14 14:49:34 UTC 2016

Modified Files:
        src/lib/libedit: chared.c chared.h chartype.h common.c emacs.c
            keymacro.c makelist map.c parse.c refresh.c refresh.h search.c
            search.h terminal.c terminal.h tty.c vi.c

Log Message:
>From Ingo Schwarze:

As we have seen before, "histedit.h" can never get rid of including
the <wchar.h> header because using the data types defined there is
deeply ingrained in the public interfaces of libedit.

Now POSIX unconditionally requires that <wchar.h> defines the type
wint_t.  Consequently, it can be used unconditionally, no matter
whether WIDECHAR is active or not.  Consequently, the #define Int
is pointless.

Note that removing it is not gratuitious churn.  Auditing for
integer signedness problems is already hard when only fundamental
types like "int" and "unsigned" are involved.  It gets very hard
when types come into the picture that have platform-dependent
signedness, like "char" and "wint_t".  Adding yet another layer
on top, changing both the signedness and the width in a platform-
dependent way, makes auditing yet harder, which IMHO is really
dangerous.  Note that while removing the #define, i already found
one bug caused by this excessive complication - in the function
re_putc() in refresh.c.  If WIDECHAR was defined, it printed an
Int = wint_t value with %c.  Fortunately, that bug only affects
debugging, not production.  The fix is contained in the patch.

With WIDECHAR, this doesn't change anything.  For the case without
WIDECHAR, i checked that none of the places wants to store values
that might not fit in wint_t.

This only changes internal interfaces; public ones remain unchanged.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libedit/chared.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libedit/chared.h
cvs rdiff -u -r1.18 -r1.19 src/lib/libedit/chartype.h \
    src/lib/libedit/makelist
cvs rdiff -u -r1.30 -r1.31 src/lib/libedit/common.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/emacs.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libedit/keymacro.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/map.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libedit/parse.c
cvs rdiff -u -r1.38 -r1.39 src/lib/libedit/refresh.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libedit/refresh.h
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/search.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/search.h
cvs rdiff -u -r1.15 -r1.16 src/lib/libedit/terminal.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/terminal.h
cvs rdiff -u -r1.50 -r1.51 src/lib/libedit/tty.c
cvs rdiff -u -r1.47 -r1.48 src/lib/libedit/vi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index