This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/17104] CFLAGS="-Wall -Wextra" gdb/confgure --with-babeltrace fails


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]