Change in osmo-hlr[master]: db: Avoid use uninitialized rc if running 0 statements

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Jul 15 12:04:29 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/24951 )

Change subject: db: Avoid use uninitialized rc if running 0 statements
......................................................................

db: Avoid use uninitialized rc if running 0 statements

Caught by new gcc 11.1.0:
/git/osmo-hlr/src/db.c:257:16: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  257 |         return rc;
      |                ^~

Change-Id: I45e1fede234cd4446a7061fb908bf344eee72f5a
---
M src/db.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/db.c b/src/db.c
index 3a7cf49..4fd2654 100644
--- a/src/db.c
+++ b/src/db.c
@@ -234,7 +234,7 @@
 
 static int db_run_statements(struct db_context *dbc, const char **statements, size_t statements_count)
 {
-	int rc;
+	int rc = 0;
 	int i;
 	for (i = 0; i < statements_count; i++) {
 		const char *stmt_str = statements[i];

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/24951
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I45e1fede234cd4446a7061fb908bf344eee72f5a
Gerrit-Change-Number: 24951
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210715/7d3932c1/attachment.htm>


More information about the gerrit-log mailing list