simon-git: puzzles (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Thu Dec 31 08:37:33 GMT 2015


TL;DR:
  ff91d2d rect: Fix compiler errors about uninitialized use of variables

Repository:     git://git.tartarus.org/simon/puzzles.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2015-12-31 08:37:33

commit ff91d2d78d96441893acd1b1099726346e7f84cf
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=ff91d2d78d96441893acd1b1099726346e7f84cf;hp=d295a8a93c88bbd65ecfa57f4b70c9c4c6286e97
Author: Khem Raj <raj.khem at gmail.com>
Date:   Wed Dec 30 23:53:36 2015 +0000

    rect: Fix compiler errors about uninitialized use of variables
    
    error: 'r2.x' may be used uninitialized in this function
    
    Its happening when using gcc 5.3 with musl C library. its considering
    the case when case falls into default and immediately after exiting
    this there is a check if (r1.h > 0 && r1.w > 0) where r1 element is
    used but not assigned anything.
    
    GCC is not noticing the control flow where the initilization will
    always work due to assertion call can be a function call from libc
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>

 rect.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list