Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654202 - games-puzzle/sgt-puzzles-20171029 - ./lightup.c:123:40: error: ‘ys[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Summary: games-puzzle/sgt-puzzles-20171029 - ./lightup.c:123:40: error: ‘ys[2]’ may be...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: werror
  Show dependency tree
 
Reported: 2018-04-27 16:43 UTC by Bruce Guenter
Modified: 2018-04-28 19:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
games-puzzle:sgt-puzzles-20171029:20180427-155609.log (games-puzzle:sgt-puzzles-20171029:20180427-155609.log,23.88 KB, text/plain)
2018-04-27 16:43 UTC, Bruce Guenter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce Guenter 2018-04-27 16:43:37 UTC
Created attachment 528710 [details]
games-puzzle:sgt-puzzles-20171029:20180427-155609.log

While building =games-puzzle/sgt-puzzles-20171029, several errors result from the use of -Werror in CFLAGS.

./lightup.c: In function ‘new_game_desc’:
./lightup.c:123:40: error: ‘ys[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 #define GRID(gs,grid,x,y) (gs->grid[(y)*((gs)->w) + (x)])
                                        ^
./lightup.c:574:16: note: ‘ys[2]’ was declared here
     int xs[4], ys[4];
                ^~
./lightup.c:123:51: error: ‘xs[3]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 #define GRID(gs,grid,x,y) (gs->grid[(y)*((gs)->w) + (x)])
                                                   ^
./lightup.c:574:9: note: ‘xs[3]’ was declared here
     int xs[4], ys[4];
         ^~
./lightup.c:123:51: error: ‘xs[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 #define GRID(gs,grid,x,y) (gs->grid[(y)*((gs)->w) + (x)])
                                                   ^
./lightup.c:574:9: note: ‘xs[2]’ was declared here
     int xs[4], ys[4];
         ^~
/mines.c: In function ‘ss_overlap.isra.10.constprop’:
cc1: error: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Werror=strict-overflow]
./mines.c: In function ‘minegen’:
cc1: error: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Werror=strict-overflow]

Adding the following line to src_prepare in the ebuild fixes the problem, but may not be the complete solution:

sed -i -e 's/ -Werror / /' configure.ac configure
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2018-04-28 10:30:00 UTC
Fixed without revision bump.

commit f7888cd11398109bc79e872d86379a578d0f7898
Author: Jeroen Roovers <jer@gentoo.org>
Date:   Sat Apr 28 12:29:20 2018 +0200

    games-puzzle/sgt-puzzles: Drop -Werror (bug #654202).

    Package-Manager: Portage-2.3.31, Repoman-2.3.9