simon-git: ipbt (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Tue Aug 21 18:33:16 BST 2018


TL;DR:
  360294d1 LICENCE: Update copyright dates, and add a missing credit
  283f3e08 LICENCE: Add missing contributors
  d41a4f5b licencemsg: Drop full list of contributors and copyright dates
  c2fa2c55 autogen.sh: Provide this script
  d7fc04f4 ipbt.c: Reduce a buffer length to placate gcc8 warnings

Repository:     https://git.tartarus.org/simon/ipbt.git
On the web:     https://git.tartarus.org/?p=simon/ipbt.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-08-21 18:33:16

commit 360294d11b3257963b3558f9e424719506e3384a
web diff https://git.tartarus.org/?p=simon/ipbt.git;a=commitdiff;h=360294d11b3257963b3558f9e424719506e3384a;hp=3c40fd326a4729e21136c8a113274defae28eb7d
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date:   Tue Aug 21 01:54:40 2018 +0100

    LICENCE: Update copyright dates, and add a missing credit
    
    I observe David's name in the git history.
    
    Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

 LICENCE | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

commit 283f3e0885b9c529304e5635f909613a0d0e943f
web diff https://git.tartarus.org/?p=simon/ipbt.git;a=commitdiff;h=283f3e0885b9c529304e5635f909613a0d0e943f;hp=360294d11b3257963b3558f9e424719506e3384a
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date:   Tue Aug 21 01:54:41 2018 +0100

    LICENCE: Add missing contributors
    
    Results are from searching `git-log'.
    
    Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

 LICENCE | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

commit d41a4f5bc951fa6041838ce4dd1b221d7a9a1044
web diff https://git.tartarus.org/?p=simon/ipbt.git;a=commitdiff;h=d41a4f5bc951fa6041838ce4dd1b221d7a9a1044;hp=283f3e0885b9c529304e5635f909613a0d0e943f
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date:   Tue Aug 21 01:54:42 2018 +0100

    licencemsg: Drop full list of contributors and copyright dates
    
    This is not needed, out of date, and it doesn't seem like there is any
    machinery for updating it.
    
    Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

 ipbt.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

commit c2fa2c555c2e866be3b81fed0ea8eb0fdf2b7383
web diff https://git.tartarus.org/?p=simon/ipbt.git;a=commitdiff;h=c2fa2c555c2e866be3b81fed0ea8eb0fdf2b7383;hp=d41a4f5bc951fa6041838ce4dd1b221d7a9a1044
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date:   Tue Aug 21 01:54:43 2018 +0100

    autogen.sh: Provide this script
    
    This is a conventional entrypoint for rerunning autoconf.
    
    Debian's dh_autoreconf doesn't need it but it is useful for humans
    and perhaps some other tools.
    
    Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

 autogen.sh | 2 ++
 1 file changed, 2 insertions(+)

commit d7fc04f4ed619df993ea0e06ef94177161abeb32
web diff https://git.tartarus.org/?p=simon/ipbt.git;a=commitdiff;h=d7fc04f4ed619df993ea0e06ef94177161abeb32;hp=c2fa2c555c2e866be3b81fed0ea8eb0fdf2b7383
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date:   Tue Aug 21 01:55:06 2018 +0100

    ipbt.c: Reduce a buffer length to placate gcc8 warnings
    
    gcc8 is capable of calculating the maximum length of various format
    strings.  The existing code produces these warnings:
    
     ipbt.c:940:28: warning: '%20s' directive writing between 20 and 79 bytes into a region of size 73 [-Wformat-overflow=]
           sprintf(buf4, " Speed:%20s ", buf2);
                                 ^~~~    ~~~~
    
     ipbt.c:944:24: warning: '%20s' directive writing between 20 and 79 bytes into a region of size 73 [-Wformat-overflow=]
       sprintf(buf1, " Frame:%20s ", buf2);
                             ^~~~    ~~~~
    
    AFAICT the root cause is as follows: gcc can tell that %s buf2 will
    produce at most 79 bytes, because buf2 is [80].  But buf4 and buf1
    are also [80] and therefore this `might not fit'.
    
    In fact, the contents of buf2 is one of
    
      "%s x %g", where %s gets a short constant.  %g has a precision of 6
      by default so this is clearly much less than 60.
    
      "%d / %d", which even with 64-bit ints is well under 80 bytes,
      since %d is at most 21.
    
      " Time:%21.3f ".  This is more complicated.  The argument is t/1E6.
      t is made by shifting an unsigned << 32, and adding another
      unsigned.  (The code intent is clearly that each int is <2^32, but
      even if it's a full 64-bit int then that's worst case (2^96-1)/1E6,
      which takes only 28 characters.  Still well under 60.
    
    So all of these are well under 60 bytes.
    
    Changing the size of buf2 to 60 bytes allows the checks for the
    sprintfs to consume it to pass.  Also, it's not too short.
    (Assuming ints are no longer than 64 bits.)
    
    Incidentally, experimentation with smaller values of 60 shows that
    gcc8 sometimes makes rather optimistic assumptions about the values
    passed.  For example, buf2[28] produces:
    
      ipbt.c:945:23: warning: '%21.3f' directive writing between 21 and 314 bytes into a region of size 20 [-Wformat-overflow=]
        sprintf(buf2, " Time:%21.3f ", t / 1000000.0);
                             ^~~~~~
    
    But buf[29] produces no warning even though it evidently hasn't
    reasoned the way I did above, about the value of t.
    
    Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

 ipbt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list