]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix up various compiler warnings found with gcc-4.3:
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 11:04:29 +0000 (11:04 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 11:04:29 +0000 (11:04 +0000)
- 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/branches/1.4@107352 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/Makefile
main/editline/readline.c
main/udptl.c
pbx/Makefile
utils/Makefile

index c9de882737f48b01a46296424500cf675f009e75..9a70e1f4f55ff53fea54783ea56b1d53895d5892 100644 (file)
@@ -113,6 +113,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
@@ -121,6 +123,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)))
index 3fbbb79a51e5bb8d654697b39764395d837caa22..3a62df6286d4faa34691ed265e8565d3bf6edb4c 100644 (file)
@@ -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) {
index 06c5e3e74edb52830d21b21ea44a690b10001ff7..718b46fb84e137c5a610e2844e4f6ff90d53499c 100644 (file)
@@ -844,6 +844,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;
@@ -1009,13 +1010,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);
        }
index f3a97b55e9b920fdae4bb6c9cfbecb9a8565e962..b7a8c006715197601783bfa850d0324a83e27f0f 100644 (file)
@@ -35,7 +35,7 @@ clean::
        rm -f ael/*.o
 
 ael/ael_lex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
-ael/ael_lex.o: ASTCFLAGS+=-I.
+ael/ael_lex.o: ASTCFLAGS+=-I. -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.
index 4703e2c845c99da082d335bbc5a443fceb56e9e7..07896260f4e42ef0ca4bf27b1c460290cd4712db 100644 (file)
@@ -86,7 +86,7 @@ ast_expr2.c: ../main/ast_expr2.c
 ast_expr2f.c: ../main/ast_expr2f.c
        @cp $< $@
 
-ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main
+ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main -Wno-unused
 
 check_expr: check_expr.o ast_expr2.o ast_expr2f.o
 
@@ -104,7 +104,7 @@ ael_main.o: ael_main.c ../include/asterisk/ael_structs.h
 aelparse.c: ../pbx/ael/ael_lex.c
        @cp $< $@
 aelparse.o: aelparse.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h
-aelparse.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
+aelparse.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL -Wno-unused
 
 aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o