summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-03-11 11:36:51 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-03-11 11:36:51 +0000
commit79c3038ee531e5d0678859e1f82416c6a1885055 (patch)
treefb0dd86e39fddade0dcd96af295777d21ce0197b
parenta9a3f001e0973861efd0dff2ea04d8eb0404111a (diff)
Merged revisions 107352 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r107352 | kpfleming | 2008-03-11 06:04:29 -0500 (Tue, 11 Mar 2008) | 11 lines fix up various compiler warnings found with gcc-4.3: - the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function) - main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement - main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur - main/editline/readline.c had an unused variable ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/Makefile4
-rw-r--r--main/editline/readline.c1
-rw-r--r--main/udptl.c7
-rw-r--r--res/Makefile2
-rw-r--r--utils/Makefile4
5 files changed, 12 insertions, 6 deletions
diff --git a/main/Makefile b/main/Makefile
index 8af41a5ac..13ac5e685 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -122,6 +122,8 @@ ast_expr2f.c:
sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ast_expr2f.c > zz
mv zz ast_expr2f.c
+ast_expr2f.o: ASTCFLAGS+=-Wno-unused
+
testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2.c
@@ -130,6 +132,8 @@ testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
+stdtime/localtime.o: ASTCFLAGS+=-fno-strict-overflow
+
AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
AST_EMBED_LIBS:=$(foreach dep,$(EMBED_LIBS),$(value $(dep)))
diff --git a/main/editline/readline.c b/main/editline/readline.c
index 3fbbb79a5..3a62df628 100644
--- a/main/editline/readline.c
+++ b/main/editline/readline.c
@@ -1203,7 +1203,6 @@ filename_completion_function(const char *text, int state)
struct dirent *entry;
char *temp;
size_t len;
- int count = 0;
temp = strrchr(text, '/');
if (temp) {
diff --git a/main/udptl.c b/main/udptl.c
index 6ce344328..2f0e1fb97 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -860,6 +860,7 @@ void ast_udptl_set_peer(struct ast_udptl *udptl, struct sockaddr_in *them)
void ast_udptl_get_peer(struct ast_udptl *udptl, struct sockaddr_in *them)
{
+ memset(them, 0, sizeof(*them));
them->sin_family = AF_INET;
them->sin_port = udptl->them.sin_port;
them->sin_addr = udptl->them.sin_addr;
@@ -1013,13 +1014,15 @@ int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
}
if (pr0->set_udptl_peer(c0, p1)) {
ast_log(LOG_WARNING, "Channel '%s' failed to talk to '%s'\n", c0->name, c1->name);
+ memset(&ac1, 0, sizeof(ac1));
} else {
/* Store UDPTL peer */
ast_udptl_get_peer(p1, &ac1);
}
- if (pr1->set_udptl_peer(c1, p0))
+ if (pr1->set_udptl_peer(c1, p0)) {
ast_log(LOG_WARNING, "Channel '%s' failed to talk back to '%s'\n", c1->name, c0->name);
- else {
+ memset(&ac0, 0, sizeof(ac0));
+ } else {
/* Store UDPTL peer */
ast_udptl_get_peer(p0, &ac0);
}
diff --git a/res/Makefile b/res/Makefile
index 72f4e8ae0..92f0f336e 100644
--- a/res/Makefile
+++ b/res/Makefile
@@ -30,7 +30,7 @@ ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
endif
ael/ael_lex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
-ael/ael_lex.o: ASTCFLAGS+=-I. -Iael
+ael/ael_lex.o: ASTCFLAGS+=-I. -Iael -Wno-unused
ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
ael/ael.tab.o: ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
diff --git a/utils/Makefile b/utils/Makefile
index 5089ffe63..ca5a26c00 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -110,7 +110,7 @@ ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c
ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c
@cp $< $@
-ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I$(ASTTOPDIR)/main
+ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I$(ASTTOPDIR)/main -Wno-unused
pval.o : ASTCFLAGS+=-DSTANDALONE
@@ -129,7 +129,7 @@ pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c
@cp $< $@
-aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE_AEL
+aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE_AEL -Wno-unused
aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o