From c30a76b2d49265ba6b7ab9e1d684b507b3bfc5f4 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 16 Nov 2017 16:37:55 +0100 Subject: [PATCH] utils: Fix false positive in compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the warning below: warning: ‘sqn’ may be used uninitialized in this function [-Wmaybe-uninitialized] fprintf(stderr, "Requesting --sqn %"PRIu64" implies IND=%u," ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " so no further --ind argument is allowed.\n", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sqn, test_aud.u.umts.ind); ~~~~~~~~~~~~~~~~~~~~~~~~~ The warning is a false positive as sqn is only used in case sqn_is_set!=0, and in that code path, sqn is set. Change-Id: Ib5903db01ea6765bd6bb688e63f70925c5012f98 --- utils/osmo-auc-gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 9d1215c80..ec9bad887 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -98,7 +98,7 @@ int main(int argc, char **argv) struct osmo_auth_vector _vec; struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; - uint64_t sqn; + uint64_t sqn = 0; unsigned int ind = 0; int rc, option_index; int rand_is_set = 0;