This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug build/17104] CFLAGS="-Wall -Wextra" gdb/confgure --with-babeltrace fails
- From: "qiyao at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 01 Jul 2014 03:46:00 +0000
- Subject: [Bug build/17104] CFLAGS="-Wall -Wextra" gdb/confgure --with-babeltrace fails
- Auto-submitted: auto-generated
- References: <bug-17104-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17104
Yao Qi <qiyao at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |qiyao at gcc dot gnu.org
--- Comment #1 from Yao Qi <qiyao at gcc dot gnu.org> ---
I can reproduce it with gcc 4.8.2 (shipped on Fedora 20).
configure:15245: gcc -o conftest -Wall -Wextra -Werror
-I/home/yao/Source/lttng/babeltrace/1.1.0/install/include conftest.c -ldl
-lncurses -lz -lm
/home/yao/Source/lttng/babeltrace/1.1.0/install/lib/libbabeltrace.so
/home/yao/Source/lttng/babeltrace/1.1.0/install/lib/libbabeltrace-ctf.so -lpopt
-lgmodule-2.0 -lrt -lglib-2.0 -luuid -Wl,-rpath
-Wl,/home/yao/Source/lttng/babeltrace/1.1.0/install/lib >&5
conftest.c: In function 'main':
conftest.c:192:21: error: unused variable 'pos' [-Werror=unused-variable]
struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL));
^
cc1: all warnings being treated as errors
and this can be fixed by the following patch. However, I suspect whether GDB
can be built with '-Wall -Wextra -Werror', because even with the patch, I still
get build failure in libiberty and gdb later.
2014-07-01 Yao Qi <yao@codesourcery.com>
build/17104
* configure.ac: Use local variable 'pos'.
* configure: Regenerated.
---
gdb/configure | 1 +
gdb/configure.ac | 1 +
2 files changed, 2 insertions(+)
diff --git a/gdb/configure b/gdb/configure
index a4c0a8c..7956aa7 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15234,6 +15234,7 @@ struct bt_iter_pos *pos = bt_iter_get_pos
(bt_ctf_get_iter (NULL));
struct bt_ctf_event *event = NULL;
const struct bt_definition *scope;
+ bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
scope = bt_ctf_get_top_level_scope (event,
BT_STREAM_EVENT_HEADER);
bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id"));
diff --git a/gdb/configure.ac b/gdb/configure.ac
index a2ac15f..fc1d8bc 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2417,6 +2417,7 @@ else
struct bt_ctf_event *event = NULL;
const struct bt_definition *scope;
+ bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
scope = bt_ctf_get_top_level_scope (event,
BT_STREAM_EVENT_HEADER);
bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id"));
--
1.9.0
--
You are receiving this mail because:
You are on the CC list for the bug.