simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Jan 29 06:59:36 GMT 2020
TL;DR:
d1834847 Make prototype for new_prompts() consistent.
b7f011ae Fix misdef of platform_get_x11_unix_address on Windows.
b1bb07a8 Pageant: fix dupprintf/dupvprintf error.
f40d31b5 Fix technical-UB uses of the preprocessor.
1278f51f Remove a few completely unused functions.
787181bb Add some missing #includes.
8d747d80 Add lots of missing 'static' keywords.
76430f82 Assorted benign warning fixes.
06e9f711 Enable -Werror on clang-cl builds.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2020-01-29 06:59:36
commit d183484742670f09d5963505ff9fef5e314a4c26
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d183484742670f09d5963505ff9fef5e314a4c26;hp=22350d76685fa61c928a75c951e1fe7890817ed9
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:13:41 2020 +0000
Make prototype for new_prompts() consistent.
In commit b4c8fd9d8 which introduced the Seat trait, I got a bit
confused about the prototype of new_prompts(). Previously it took a
'Frontend *' parameter; I edited the call sites to pass a 'Seat *'
instead, but the actual function definition takes no parameters at all
- and rightly so, because the 'Frontend *' inside the prompts_t has
been removed and _not_ replaced with a 'Seat *', so the constructor
would have nothing to do with such a thing anyway.
But I wrote the function declaration in putty.h with '()' rather than
'(void)' (too much time spent in C++), and so the compiler never
spotted the mismatch.
Now new_prompts() is consistently nullary everywhere it appears: the
prototype in the header is a proper (void) one, and the call sites
have been modified to not pointlessly give it a Seat or null pointer.
cmdgen.c | 2 +-
putty.h | 2 +-
ssh1login.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
commit b7f011aed74a6f0442571da4f15c794c7adff99c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b7f011aed74a6f0442571da4f15c794c7adff99c;hp=d183484742670f09d5963505ff9fef5e314a4c26
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:13:41 2020 +0000
Fix misdef of platform_get_x11_unix_address on Windows.
Similarly to the previous commit, this function had an inconsistent
parameter list between Unix and Windows, because the Windows source
file that defines it (winnet.c) didn't include ssh.h where its
prototype lives, so the compiler never checked.
Luckily, the discrepancy was that the Windows version of the function
was declared as taking an extra parameter which it ignored, so the fix
is very easy.
windows/winnet.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
commit b1bb07a89c0b3afaaa8ebcb51e2acca6ea76d654
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b1bb07a89c0b3afaaa8ebcb51e2acca6ea76d654;hp=b7f011aed74a6f0442571da4f15c794c7adff99c
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:13:41 2020 +0000
Pageant: fix dupprintf/dupvprintf error.
This mistake was introduced very recently, in commit de38a4d82..
pageant.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit f40d31b5ccb6b771d516916294cf75eac3f15ed5
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f40d31b5ccb6b771d516916294cf75eac3f15ed5;hp=b1bb07a89c0b3afaaa8ebcb51e2acca6ea76d654
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:13:41 2020 +0000
Fix technical-UB uses of the preprocessor.
A recent test-compile at high warning level points out that if you
define a macro with a ... at the end of the parameter list, then every
call should at least include the comma before the variadic part. That
is, if you #define MACRO(x,y,...) then you shouldn't call MACRO(1,2)
with no comma after the 2. But that's what I had done in one of my
definitions of FUNC0 in the fiddly testcrypt system.
In a similar vein, it's a mistake to use the preprocessor 'defined'
operator when it's expanded from another macro. Adjusted the setup of
BB_OK in mpint_i.h to avoid doing that.
(Neither of these has yet caused a problem in any real compile, but
best to fix them before they do.)
mpint_i.h | 6 +++++-
testcrypt.c | 34 +++++++++++++++++-----------------
2 files changed, 22 insertions(+), 18 deletions(-)
commit 1278f51f1de471b6d0effabd4c615a0abea734f7
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1278f51f1de471b6d0effabd4c615a0abea734f7;hp=f40d31b5ccb6b771d516916294cf75eac3f15ed5
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:18:03 2020 +0000
Remove a few completely unused functions.
MD5_Simple and SHA512_Simple are superseded by the general
hash_simple() in sshauxcrypt.c. The SHA-1 and SHA-256 analogues of
those functions were already removed as a side effect of reorganising
their source files for hardware acceleration, but the hashes I didn't
rewrite managed to keep their 'Simple' APIs.
mp_neg was never used in the first place. I wrote it as an obvious
companion to mp_neg_into, but since I never put either of those in the
header file, none of the rest of the code ever called them; and
internally to mpint.c, only mp_neg_into is used out of the two.
(Which makes sense, because mp_int is fundamentally an unsigned type,
so mp_neg has weird semantics - it will give you not -x but 2^k-x for
some not-entirely-specified k. mp_neg_into is actually more coherent,
because _you_ get to control k by your choice of the target mp_int.)
mpint.c | 7 -------
sshmd5.c | 10 ----------
sshsh512.c | 18 ------------------
3 files changed, 35 deletions(-)
commit 787181bb12f61f546d44002d6b5d894c760fbb31
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=787181bb12f61f546d44002d6b5d894c760fbb31;hp=1278f51f1de471b6d0effabd4c615a0abea734f7
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:19:30 2020 +0000
Add some missing #includes.
These are all intended to ensure that the declarations of things in
header files are in scope where the same thing is subsequently
defined, to make it harder to define it in a way that doesn't match.
(For example, the new #include in winnet.c would have caught the
just-fixed mis-definition of platform_get_x11_unix_address.)
unix/uxplink.c | 1 +
unix/uxputty.c | 1 +
version.c | 3 +++
windows/winnet.c | 1 +
4 files changed, 6 insertions(+)
commit 8d747d802900aed50f9ff7e0bef0f560a0ad72ef
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8d747d802900aed50f9ff7e0bef0f560a0ad72ef;hp=787181bb12f61f546d44002d6b5d894c760fbb31
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:22:01 2020 +0000
Add lots of missing 'static' keywords.
A trawl through the code with -Wmissing-prototypes and
-Wmissing-variable-declarations turned up a lot of things that should
have been internal to a particular source file, but were accidentally
global. Keep the namespace clean by making them all static.
(Also, while I'm here, a couple of them were missing a 'const': the
ONE and ZERO arrays in sshcrcda.c, and EMPTY_WINDOW_TITLE in
terminal.c.)
callback.c | 6 +++---
minibidi.c | 2 +-
mpint.c | 2 +-
portfwd.c | 2 +-
ssh.c | 2 +-
sshaes.c | 2 +-
sshcrcda.c | 4 ++--
sshdes.c | 2 +-
sshecc.c | 14 +++++++-------
sshhmac.c | 12 ++++++------
sshmd5.c | 4 ++--
sshrsa.c | 6 +++---
sshsh512.c | 8 ++++----
terminal.c | 6 +++---
testcrypt.c | 4 ++--
unix/gtkdlg.c | 4 ++--
unix/uxpgnt.c | 2 +-
unix/x11misc.c | 5 ++---
windows/winpgnt.c | 2 +-
windows/winpgntc.c | 2 +-
windows/winsecur.c | 2 +-
21 files changed, 46 insertions(+), 47 deletions(-)
commit 76430f8237c1b0027c86e51cd675270abe155ee0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=76430f8237c1b0027c86e51cd675270abe155ee0;hp=8d747d802900aed50f9ff7e0bef0f560a0ad72ef
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Jan 29 06:35:53 2020 +0000
Assorted benign warning fixes.
These were just too footling for even me to bother splitting up into
multiple commits:
- a couple of int -> size_t changes left out of the big-bang commit
0cda34c6f
- a few 'const' added to pointer-type casts that are only going to be
read from (leaving out the const provokes a warning if the pointer
was const _before_ the cast)
- a couple of 'return' statements trying to pass the void return of
one function through to another.
- another missing (void) in a declaration in putty.h (but this one
didn't cause any knock-on confusion).
- a few tweaks to macros, to arrange that they eat a semicolon after
the macro call (extra do ... while (0) wrappers, mostly, and one
case where I had to do it another way because the macro included a
variable declaration intended to remain in scope)
- reworked key_type_to_str to stop putting an unreachable 'break'
statement after every 'return'
- removed yet another type-check of a function loaded from a Windows
system DLL
- and finally, a totally spurious semicolon right after an open brace
in mainchan.c.
cmdline.c | 5 ++---
logging.c | 2 +-
mainchan.c | 2 +-
mpint.c | 4 ++--
pageant.c | 4 ++--
putty.h | 2 +-
ssh.c | 3 ++-
ssh.h | 4 ++--
sshcr.h | 14 +++++++-------
sshpubk.c | 37 +++++++++++++++++++++++++------------
sshsh512.c | 27 ++++++++++++++-------------
windows/winnet.c | 9 ++++-----
12 files changed, 63 insertions(+), 50 deletions(-)
commit 06e9f7115317ea9684ea707ba203c7ed79ea90b1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=06e9f7115317ea9684ea707ba203c7ed79ea90b1;hp=76430f8237c1b0027c86e51cd675270abe155ee0
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Jan 28 06:33:57 2020 +0000
Enable -Werror on clang-cl builds.
Most of our makefiles use -Werror, and it seems silly not to do the
same for the Windows clang-cl builds.
The w32old build was not warning-clean, for a reason I can't do much
about: something in the VS2003 headers gives a lot of warnings about
mismatched #pragma pack push/pop between system header files. I don't
see anything much I can do about that except to squelch the warning
with -Wno-pragma-pack.
Buildscr | 2 +-
mkfiles.pl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list