[Asterisk-code-review] various: Fix GCC 11 compilation issues. (asterisk[18])

Michael Bradeen asteriskteam at digium.com
Tue Oct 12 13:43:20 CDT 2021


Michael Bradeen has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16607 )


Change subject: various: Fix GCC 11 compilation issues.
......................................................................

various: Fix GCC 11 compilation issues.

test_voicemail_api: Use empty char* for empty_msg_ids.
chan_skinny: Fix size of calledParty to be maximum extension.
menuselect: Change Makefile to stop deprecated warnings. Added comments

ASTERISK-29682
Reported by: George Joseph

Change-Id: If4fe42222c8444dc16828a42731ee53b4ce5cbbe
---
M channels/chan_skinny.c
M menuselect/Makefile
M tests/test_voicemail_api.c
3 files changed, 8 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/16607/1

diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index c908b61..7d1d510 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -313,7 +313,7 @@
 
 #define ENBLOC_CALL_MESSAGE 0x0004
 struct enbloc_call_message {
-	char calledParty[24];
+	char calledParty[AST_MAX_EXTENSION];
 };
 
 #define STIMULUS_MESSAGE 0x0005
diff --git a/menuselect/Makefile b/menuselect/Makefile
index c310c18..ba78275 100644
--- a/menuselect/Makefile
+++ b/menuselect/Makefile
@@ -22,7 +22,9 @@
 
 # Basic set of sources and flags/libraries/includes
 OBJS:=menuselect.o strcompat.o
-CFLAGS+=-g -D_GNU_SOURCE -Wall
+# Adding -Wdeprecated-declarations to deal with internal deprecation warnings
+# from gtk+ for GTypeDebugFlags and GTimeVal deprecated in later glib versions
+CFLAGS+=-g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations
 
 ifneq ($(findstring dragonfly,$(OSARCH)),)
   CFLAGS += -isystem /usr/local/include
diff --git a/tests/test_voicemail_api.c b/tests/test_voicemail_api.c
index e467572..2338e38 100644
--- a/tests/test_voicemail_api.c
+++ b/tests/test_voicemail_api.c
@@ -1156,7 +1156,7 @@
 {
 	const char *inbox_msg_id;
 	const char *multi_msg_ids[2];
-	const char *empty_msg_ids[] = { };
+	const char *empty_msg_ids = "";
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -1207,7 +1207,7 @@
 	VM_API_REMOVE_MESSAGE_OFF_NOMINAL("test_vm_api_2345", "default", 2, "INBOX", multi_msg_ids);
 
 	ast_test_status_update(test, "Test removing no messages with no message numbers\n");
-	VM_API_REMOVE_MESSAGE_OFF_NOMINAL("test_vm_api_1234", "default", 0, "INBOX", empty_msg_ids);
+	VM_API_REMOVE_MESSAGE_OFF_NOMINAL("test_vm_api_1234", "default", 0, "INBOX", &empty_msg_ids);
 
 	ast_test_status_update(test, "Test removing multiple messages with an invalid size specifier\n");
 	VM_API_REMOVE_MESSAGE_OFF_NOMINAL("test_vm_api_2345", "default", -30, "INBOX", multi_msg_ids);
@@ -1330,7 +1330,7 @@
 	const char *inbox_msg_id;
 	const char *multi_msg_ids[4];
 
-	const char *empty_msg_ids[] = { };
+	const char *empty_msg_ids = "";
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -1393,7 +1393,7 @@
 	VM_API_FORWARD_MESSAGE_OFF_NOMINAL("test_vm_api_1234", "default", "INBOX", "test_vm_api_2345", "default", NULL, 1, &inbox_msg_id, 0);
 
 	ast_test_status_update(test, "Test forwarding when no messages are select\n");
-	VM_API_FORWARD_MESSAGE_OFF_NOMINAL("test_vm_api_1234", "default", "INBOX", "test_vm_api_2345", "default", "INBOX", 0, empty_msg_ids, 0);
+	VM_API_FORWARD_MESSAGE_OFF_NOMINAL("test_vm_api_1234", "default", "INBOX", "test_vm_api_2345", "default", "INBOX", 0, &empty_msg_ids, 0);
 
 	ast_test_status_update(test, "Test forwarding a message that doesn't exist\n");
 	inbox_msg_id = "POOPOO";

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: If4fe42222c8444dc16828a42731ee53b4ce5cbbe
Gerrit-Change-Number: 16607
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211012/ede54028/attachment.html>


More information about the asterisk-code-review mailing list