[Bugs] [Bug 1426052] New: ‘state’ set but not used error when r =?UTF-8?Q?eadline=20and?=/ or ncurses is not installed

bugzilla at redhat.com bugzilla at redhat.com
Thu Feb 23 06:27:17 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1426052

            Bug ID: 1426052
           Summary: ‘state’ set but not used error when readline and/or
                    ncurses is not installed
           Product: GlusterFS
           Version: mainline
         Component: cli
          Assignee: bugs at gluster.org
          Reporter: nigelb at redhat.com
                CC: bugs at gluster.org



I was testing smoke on the new machines in the cage when I ran into this

20:03:12 Making install in cli
20:03:12 Making install in src
20:03:12   CC       cli.o
20:03:12   CC       registry.o
20:03:12 /home/jenkins/root/workspace/smoke/cli/src/cli.c: In function
‘_cli_err’:
20:03:12 /home/jenkins/root/workspace/smoke/cli/src/cli.c:520:27: error:
variable ‘state’ set but not used [-Werror=unused-but-set-variable]
20:03:12          struct cli_state *state = NULL;
20:03:12                            ^
20:03:12 /home/jenkins/root/workspace/smoke/cli/src/cli.c: In function
‘_cli_out’:
20:03:12 /home/jenkins/root/workspace/smoke/cli/src/cli.c:546:27: error:
variable ‘state’ set but not used [-Werror=unused-but-set-variable]
20:03:12          struct cli_state *state = NULL;
20:03:12                            ^
20:03:12 cc1: all warnings being treated as errors

This happened because readline and ncurses weren't installed on the machine.

state was set in line 524:

state = global_state;

But only used if HAVE_READLINE is true. This failure defeats the purpose of
putting HAVE_READLINE behind a flag. The code should work in both cases. We
will get the right packages on the build machines, but this will be good to fix
too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list