From: Aurelien Jacobs Date: Sat, 5 Apr 2014 15:42:33 +0000 (+0200) Subject: fx2lafw: fix possible use of uninitialized variable (gcc-4.9 warning fix) X-Git-Tag: libsigrok-0.3.0~91 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eb28f1b7b2c89a9986e799adcfffe2e2fc9c72b6;p=libsigrok.git fx2lafw: fix possible use of uninitialized variable (gcc-4.9 warning fix) hardware/fx2lafw/protocol.c: In function 'fx2lafw_command_start_acquisition': hardware/fx2lafw/protocol.c:113:7: warning: 'cmd.flags' may be used uninitialized in this function [-Wmaybe-uninitialized] (cmd.flags & CMD_START_FLAGS_CLK_48MHZ) ? "48" : "30"); ^ --- diff --git a/hardware/fx2lafw/protocol.c b/hardware/fx2lafw/protocol.c index f4f23e37..a19b3243 100644 --- a/hardware/fx2lafw/protocol.c +++ b/hardware/fx2lafw/protocol.c @@ -87,7 +87,7 @@ static int command_get_revid_version(libusb_device_handle *devhdl, SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl, uint64_t samplerate, gboolean samplewide) { - struct cmd_start_acquisition cmd; + struct cmd_start_acquisition cmd = { 0 }; int delay = 0, ret; /* Compute the sample rate. */