[Asterisk-code-review] chan_dahdi: Address gcc9 issues (...asterisk[13])

George Joseph asteriskteam at digium.com
Mon Jun 17 12:13:47 CDT 2019


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11474


Change subject: chan_dahdi:  Address gcc9 issues
......................................................................

chan_dahdi:  Address gcc9 issues

There are format format-truncation issues in chan_dahdi.c and
sig_analog.c but because they are related to fields provided
by dahdi-tools, the only solution is to mark them as acceptable
using

Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5
---
M channels/chan_dahdi.c
M channels/sig_analog.c
2 files changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/74/11474/1

diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index d425b32..8fcd92e 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -7740,8 +7740,10 @@
 				c++;
 			else
 				c = p->dialdest;
+#pragma GCC diagnostic ignored "-Wformat-truncation"
 			if (*c) snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*0%s#", c);
 			else ast_copy_string(p->dop.dialstr,"M*2#", sizeof(p->dop.dialstr));
+#pragma GCC diagnostic warning "-Wformat-truncation"
 			if (strlen(p->dop.dialstr) > 4) {
 				memset(p->echorest, 'w', sizeof(p->echorest) - 1);
 				strcpy(p->echorest + (p->echotraining / 401) + 1, p->dop.dialstr + strlen(p->dop.dialstr) - 2);
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index ea0c31d..43d2d69 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -2957,11 +2957,13 @@
 			} else {
 				c = p->dialdest;
 			}
+#pragma GCC diagnostic ignored "-Wformat-truncation"
 			if (*c) {
 				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*0%s#", c);
 			} else {
 				ast_copy_string(p->dop.dialstr,"M*2#", sizeof(p->dop.dialstr));
 			}
+#pragma GCC diagnostic warning "-Wformat-truncation"
 			if (strlen(p->dop.dialstr) > 4) {
 				memset(p->echorest, 'w', sizeof(p->echorest) - 1);
 				strcpy(p->echorest + (p->echotraining / 401) + 1, p->dop.dialstr + strlen(p->dop.dialstr) - 2);

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5
Gerrit-Change-Number: 11474
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190617/8105caf7/attachment.html>


More information about the asterisk-code-review mailing list