diff options
author | Karel Klic <kklic@redhat.com> | 2009-11-30 16:42:58 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2009-11-30 16:42:58 +0100 |
commit | 277c2b79dd8d4bfa9eac979bcb51dc050ff1627b (patch) | |
tree | bd0f27e13150f9ec427ee1e78b4967e9de7b607c /src/Backtrace | |
parent | 3b97c373a8d6bce4fa8b8ae5f014f83dab39d09a (diff) | |
download | abrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.tar.gz abrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.tar.xz abrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.zip |
Added -Wall CFLAG and fixed all warnings.
Diffstat (limited to 'src/Backtrace')
-rw-r--r-- | src/Backtrace/Makefile.am | 2 | ||||
-rw-r--r-- | src/Backtrace/backtrace.c | 8 | ||||
-rw-r--r-- | src/Backtrace/fallback.c | 3 | ||||
-rw-r--r-- | src/Backtrace/parser.y | 3 | ||||
-rw-r--r-- | src/Backtrace/strbuf.c | 2 |
5 files changed, 15 insertions, 3 deletions
diff --git a/src/Backtrace/Makefile.am b/src/Backtrace/Makefile.am index e188c460..cfd0353b 100644 --- a/src/Backtrace/Makefile.am +++ b/src/Backtrace/Makefile.am @@ -4,6 +4,8 @@ bin_PROGRAMS = abrt-backtrace #AM_YFLAGS = -d AM_YFLAGS = --verbose +abrt_backtrace_CFLAGS = -Wall + abrt_backtrace_SOURCES = \ main.c \ backtrace.h backtrace.c \ diff --git a/src/Backtrace/backtrace.c b/src/Backtrace/backtrace.c index 5e2d4bbd..5a112732 100644 --- a/src/Backtrace/backtrace.c +++ b/src/Backtrace/backtrace.c @@ -97,6 +97,7 @@ struct thread *thread_new() t->number = 0; t->frames = NULL; t->next = NULL; + return t; } void thread_free(struct thread *t) @@ -214,6 +215,7 @@ struct backtrace *backtrace_new() bt->threads = NULL; bt->crash = NULL; + return bt; } void backtrace_free(struct backtrace *bt) @@ -363,7 +365,7 @@ void backtrace_limit_frame_depth(struct backtrace *backtrace, int depth) /* Skip some frames to get the required stack depth. */ int i = depth; - struct frame *last_frame; + struct frame *last_frame = NULL; while (frame && i) { last_frame = frame; @@ -372,7 +374,9 @@ void backtrace_limit_frame_depth(struct backtrace *backtrace, int depth) } /* Delete the remaining frames. */ - last_frame->next = NULL; + if (last_frame) + last_frame->next = NULL; + while (frame) { struct frame *rm = frame; diff --git a/src/Backtrace/fallback.c b/src/Backtrace/fallback.c index 70e5e43a..77a16283 100644 --- a/src/Backtrace/fallback.c +++ b/src/Backtrace/fallback.c @@ -18,6 +18,9 @@ #include "fallback.h" #include <stdlib.h> #include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> struct header { diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index b10184d2..76dd7de4 100644 --- a/src/Backtrace/parser.y +++ b/src/Backtrace/parser.y @@ -1,5 +1,4 @@ %{ /* -*- mode: yacc -*- -/* Copyright (C) 2009 RedHat inc. This program is free software; you can redistribute it and/or modify @@ -31,6 +30,8 @@ void yyerror(char const *s) fprintf (stderr, "\nParser error: %s\n", s); } +int yylex(); + %} /* This defines the type of yylval */ diff --git a/src/Backtrace/strbuf.c b/src/Backtrace/strbuf.c index c919354d..4c6d886b 100644 --- a/src/Backtrace/strbuf.c +++ b/src/Backtrace/strbuf.c @@ -19,6 +19,7 @@ */ #include "strbuf.h" #include <stdlib.h> +#include <stdio.h> #include <assert.h> #include <string.h> @@ -107,4 +108,5 @@ struct strbuf *strbuf_prepend_str(struct strbuf *strbuf, char *str) assert(strbuf->len + len < strbuf->alloc); memmove(strbuf->buf + len, strbuf->buf, strbuf->len + 1); memcpy(strbuf->buf, str, len); + return strbuf; } |