mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
futility: Initialize stack variables
This suppresses following 'maybe-uninitialized' gcc 4.9.2 errors:
CC futility/futility.o
futility/futility.c: In function ‘do_help’:
futility/futility.c:262:2: error: ‘vstr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
printf("The following %scommands are built-in:\n\n", vstr);
^
cc1: all warnings being treated as errors
host/lib21/host_misc.c: In function ‘vb2_str_to_id’:
host/lib21/host_misc.c:154:14: error: ‘val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
id->raw[i] = val;
^
cc1: all warnings being treated as errors
BUG=none
BRANCH=none
TEST=compile, run unit tests
Change-Id: I6b9d19f2d6e9deb2010dd22602d2a3310f4db335
Signed-off-by: Anatol Pomazau <anatol@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/265370
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Anatol Pomazau <anatol@google.com>
Tested-by: Anatol Pomazau <anatol@google.com>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
c1a96b0f42
commit
57e881dedc
@@ -230,7 +230,7 @@ static int run_command(const struct futil_cmd_t *cmd, int argc, char *argv[])
|
||||
static int do_help(int argc, char *argv[])
|
||||
{
|
||||
const struct futil_cmd_t *cmd;
|
||||
const char *vstr;
|
||||
const char *vstr = "";
|
||||
|
||||
/* Help about a known command? */
|
||||
if (argc > 1) {
|
||||
|
||||
@@ -138,7 +138,7 @@ static const char *onebyte(const char *str, uint8_t *vptr)
|
||||
|
||||
int vb2_str_to_id(const char *str, struct vb2_id *id)
|
||||
{
|
||||
uint8_t val;
|
||||
uint8_t val = 0;
|
||||
int i;
|
||||
|
||||
if (!str)
|
||||
|
||||
Reference in New Issue
Block a user