diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-12-30 23:34:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-22 23:42:48 +0000 |
commit | dda96dbb3e4cd83fe6b8fd8370c8ca2a737cc078 (patch) | |
tree | ebb2c5512fbc99b92501c31f004dba321a6d3d5d | |
parent | 610a9f102a83e1ffb9d7954e40df5f65d24d3a26 (diff) | |
download | openembedded-core-dda96dbb3e4cd83fe6b8fd8370c8ca2a737cc078.tar.gz openembedded-core-dda96dbb3e4cd83fe6b8fd8370c8ca2a737cc078.tar.bz2 openembedded-core-dda96dbb3e4cd83fe6b8fd8370c8ca2a737cc078.zip |
puzzles: Zero'ise structs before use
Fixes build failures with musl where gcc5 flags it used before
initialized.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch | 32 | ||||
-rw-r--r-- | meta/recipes-sato/puzzles/puzzles_git.bb | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch b/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch new file mode 100644 index 0000000000..0b971c432e --- /dev/null +++ b/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch @@ -0,0 +1,32 @@ +From 78d6d1706c21ad467520075ff7a8bf15cfbd68b3 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 30 Dec 2015 22:13:16 +0000 +Subject: [PATCH] rect: Fix compiler errors about uninitialized use of + variables + +error: 'r2.x' may be used uninitialized in this function + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + rect.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rect.c b/rect.c +index 55667c0..fa3a786 100644 +--- a/rect.c ++++ b/rect.c +@@ -1317,7 +1317,8 @@ static char *new_game_desc(const game_params *params_in, random_state *rs, + if (ndirs > 0) { + int which, dir; + struct rect r1, r2; +- ++ memset(&r1, 0, sizeof(struct rect)); ++ memset(&r2, 0, sizeof(struct rect)); + which = random_upto(rs, ndirs); + dir = dirs[which]; + +-- +2.6.4 + diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb index 1e3bac7458..9c8170cbdb 100644 --- a/meta/recipes-sato/puzzles/puzzles_git.bb +++ b/meta/recipes-sato/puzzles/puzzles_git.bb @@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc" SRC_URI = "git://git.tartarus.org/simon/puzzles.git \ file://fix-compiling-failure-with-option-g-O.patch \ file://0001-Use-labs-instead-of-abs.patch \ + file://0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \ " SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed" PE = "1" |