[Asterisk-code-review] Compiler fixes for GCC with -Og (asterisk[18])

Kevin Harwell asteriskteam at digium.com
Tue Nov 3 17:07:45 CST 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15102 )

Change subject: Compiler fixes for GCC with -Og
......................................................................

Compiler fixes for GCC with -Og

ASTERISK-29144

Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
---
M addons/ooh323c/src/ooq931.c
M apps/app_directory.c
M apps/app_voicemail.c
M channels/chan_audiosocket.c
M funcs/func_odbc.c
5 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, approved; Approved for Submit
  George Joseph: Looks good to me, but someone else must approve



diff --git a/addons/ooh323c/src/ooq931.c b/addons/ooh323c/src/ooq931.c
index 01a8e4a..fc18703 100644
--- a/addons/ooh323c/src/ooq931.c
+++ b/addons/ooh323c/src/ooq931.c
@@ -585,7 +585,7 @@
    unsigned int i;
    ASN1BOOL aligned=TRUE;
    int stat;
-   Q931InformationElement *ie;
+   Q931InformationElement *ie=NULL;
    /* OOCTXT *pctxt = &gH323ep.msgctxt; */
    if(q931Msg ==NULL)
    {
diff --git a/apps/app_directory.c b/apps/app_directory.c
index a47fe3b..36da702 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -396,7 +396,7 @@
 {
 	struct directory_item **block, *item;
 	int i, limit, res = 0;
-	char buf[9];
+	char buf[7+12]; /* INT_MIN has a length of 12 chars */
 
 	/* option p(n): cellphone pause option */
 	select_item_pause(chan, flags, opts);
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index bbbd6fa..c830ec3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11198,7 +11198,7 @@
 			int skipuser, int max_logins, int silent)
 {
 	int useadsi = 0, valid = 0, logretries = 0;
-	char password[AST_MAX_EXTENSION], *passptr;
+	char password[AST_MAX_EXTENSION], *passptr = NULL;
 	struct ast_vm_user vmus, *vmu = NULL;
 
 	/* If ADSI is supported, setup login screen */
diff --git a/channels/chan_audiosocket.c b/channels/chan_audiosocket.c
index 52f208c..1c9c0fb 100644
--- a/channels/chan_audiosocket.c
+++ b/channels/chan_audiosocket.c
@@ -147,7 +147,7 @@
 	struct ast_format_cap *caps = NULL;
 	struct ast_format *fmt = NULL;
 	uuid_t uu;
-	int fd;
+	int fd = -1;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(destination);
 		AST_APP_ARG(idStr);
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index e9fe597..acebdcc 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -1181,7 +1181,7 @@
 static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_query **query)
 {
 	const char *tmp;
-	const char *tmp2;
+	const char *tmp2 = NULL;
 	int i;
 
 	if (!cfg || !catg) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15102
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
Gerrit-Change-Number: 15102
Gerrit-PatchSet: 3
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201103/82bd82a7/attachment-0001.html>


More information about the asterisk-code-review mailing list