From ed2a3cedd1f786d496b487b197c6c3a27c5a8fef Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Sat, 1 Aug 2009 01:03:07 +0000
Subject: [PATCH] Merged revisions 209759 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209759 | kpfleming | 2009-07-31 19:52:00 -0500 (Fri, 31 Jul 2009) | 7 lines

  Minor changes inspired by testing with latest GCC.

  The latest GCC (what will become 4.5.x) has a few new warnings, that in these
  cases found some either downright buggy code, or at least seriously poorly
  designed code that could be improved.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 Makefile              | 2 +-
 channels/chan_dahdi.c | 2 +-
 channels/chan_misdn.c | 2 +-
 channels/misdn/ie.c   | 2 +-
 main/Makefile         | 2 +-
 pbx/pbx_config.c      | 3 ++-
 utils/frame.c         | 2 +-
 7 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index b86c214d76..9c70009696 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@ ifeq ($(AST_DEVMODE),yes)
   _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
   _ASTCFLAGS+=-Wundef 
   _ASTCFLAGS+=-Wmissing-format-attribute
-  _ASTCFLAGS+=-Wformat=2
+  _ASTCFLAGS+=-Wformat=2 -Wno-format-security
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 9bc91024c6..98a8ab3eeb 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2526,7 +2526,7 @@ static void my_pri_fixup_chans(void *old_chan, void *new_chan)
 	old->dsp_features = 0;
 }
 
-static int sig_pri_tone_to_dahditone(enum analog_tone tone)
+static int sig_pri_tone_to_dahditone(enum sig_pri_tone tone)
 {
 	switch (tone) {
 	case SIG_PRI_TONE_RINGTONE:
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 8f9d5fb0b4..a85392eed4 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -11081,7 +11081,7 @@ static int misdn_command_cc_deactivate(struct ast_channel *chan, struct misdn_co
 			error_str = misdn_no_response_from_network;
 		} else if (cc_record->reject_code != FacReject_None) {
 			error_str = misdn_to_str_reject_code(cc_record->reject_code);
-		} else if (cc_record->reject_code != FacError_None) {
+		} else if (cc_record->error_code != FacError_None) {
 			error_str = misdn_to_str_error_code(cc_record->error_code);
 		} else {
 			error_str = NULL;
diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c
index 33596098d9..818a2f279d 100644
--- a/channels/misdn/ie.c
+++ b/channels/misdn/ie.c
@@ -247,7 +247,7 @@ static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *c
 		if (p[0] <= octet)
 			goto done;
 
-		if (!p[octet++] & 0x80)
+		if (~p[octet++] & 0x80)
 			goto l2;
 
 		/* Wheee. V.110 speed information */
diff --git a/main/Makefile b/main/Makefile
index 227c4fd895..ec8790de69 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -98,7 +98,7 @@ editline/libedit.a: CHECK_SUBDIR
 	$(MAKE) -C editline libedit.a
 
 db1-ast/libdb1.a: CHECK_SUBDIR
-	CFLAGS="$(subst $(ASTTOPDIR),../../,$(_ASTCFLAGS) $(ASTCFLAGS))" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
+	_ASTCFLAGS="$(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS) -Wno-strict-aliasing" $(MAKE) -C db1-ast libdb1.a
 
 ast_expr2.c ast_expr2.h:
 	bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index cb89fd7d4b..990c4db97d 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1440,7 +1440,7 @@ static int pbx_load_config(const char *config_file)
 					goto process_extension;
 				}
 			} else if (!strcasecmp(v->name, "exten")) {
-				int ipri = -2;
+				int ipri;
 				char *plus, *firstp;
 				char *pri, *appl, *data, *cidmatch;
 
@@ -1452,6 +1452,7 @@ static int pbx_load_config(const char *config_file)
 				pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
 				ast_copy_string(lastextension, realext, sizeof(lastextension));
 process_extension:
+				ipri = -2;
 				if ((cidmatch = strchr(realext, '/'))) {
 					*cidmatch++ = '\0';
 					ast_shrink_phone_number(cidmatch);
diff --git a/utils/frame.c b/utils/frame.c
index abc3a30005..2900cb0656 100644
--- a/utils/frame.c
+++ b/utils/frame.c
@@ -744,7 +744,7 @@ void checknoargs( int argcount, char *args[])
 void parseargs( int argcount, char *args[], int fileswitch)
 {
    char *filename;
-   int tempint;
+   int tempint = 0;
 
    if ((fileswitch & 1) != 0)     /* If getting infile  */
      in = NULL;
-- 
GitLab