From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4800 invoked by alias); 12 Aug 2014 20:33:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4699 invoked by uid 89); 12 Aug 2014 20:33:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-vc0-f181.google.com Received: from mail-vc0-f181.google.com (HELO mail-vc0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 12 Aug 2014 20:32:58 +0000 Received: by mail-vc0-f181.google.com with SMTP id lf12so13751644vcb.40 for ; Tue, 12 Aug 2014 13:32:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=S06IfrI5+MLRPYojvp9gyZbtAwmQxinU4bYnW80fmtA=; b=llzknzZgfdrK2r7DED242uHDfOQqkhp6o6Bpc4/5hZAjTmjHSNDnh93JTZxlGny1/C bFoqlEo1MIO+TarZlAOxczYwoacqQkrvHCsn1GPYu3D1B8WFLl2yyqAUZyH+oLA6URpm wVeOq1QFjV2Lsm5WgzPdXK1Ki+ADxDiNjEktN0Ak7U7wcF12l4FIkkpYObvwO4rYwjLn Ooqoky2xgt4o1Eg6HUnPqsXoPc0ZmfB1LiSRnjoEYxfqmDXyOlRkJDFpQ1JqRn9QfjEb ui8xCFhxSHAvG5OBHKr5DmICgEzdTeZxx3G9ELxL5h/3urKgCHDFkY3UDJryAxBlSplx prUA== X-Gm-Message-State: ALoCoQnCl2BXLw6B8X3KrlNFqwFcAekfBJ953dD1amfNeOwoLow5Qgj0fL2i7s/2lHIeNaPOcARA MIME-Version: 1.0 X-Received: by 10.220.80.82 with SMTP id s18mr2027673vck.57.1407875575842; Tue, 12 Aug 2014 13:32:55 -0700 (PDT) Received: by 10.52.136.203 with HTTP; Tue, 12 Aug 2014 13:32:55 -0700 (PDT) In-Reply-To: <20140812192204.GA13299@host2.jankratochvil.net> References: <20140804202907.GA2608@host2.jankratochvil.net> <53E17E14.8070104@codesourcery.com> <20140812192204.GA13299@host2.jankratochvil.net> Date: Tue, 12 Aug 2014 20:33:00 -0000 Message-ID: Subject: Re: [patch+7.8?] Fix --with-babeltrace with gcc-4.9.1 From: Doug Evans To: Jan Kratochvil Cc: Yao Qi , gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00199.txt.bz2 On Tue, Aug 12, 2014 at 12:22 PM, Jan Kratochvil wrote: > On Wed, 06 Aug 2014 03:00:04 +0200, Yao Qi wrote: >> This patch fixes https://sourceware.org/bugzilla/show_bug.cgi?id=17104 >> Please mention it in ChangeLog entry. I had a patch to this PR, but >> didn't follow it up. Yours is fine. > > I think the one of yours is better, posting it here for new approval. > > IMO it could go also for 7.8.1. > > > My original reproducer is wrong, one also has to specify -Wall in CFLAGS: > CFLAGS=-Wall ./configure --with-babeltrace; make > > > Thanks, > Jan > > gdb/ > 2014-07-01 Yao Qi > > PR build/17104 > * configure.ac: Use local variable 'pos'. > * configure: Regenerated. > > 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")); > Hi. This seems like an excessive amount of code just to test whether a library exists. Do we really need all of it? E.g., can we just delete "pos" and the function call that initializes it? struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); Or, if for some reason we need to test whether bf_ctf_get_iter exists, can we just call it and discard the result? [And similarly for the rest of the code.] None of this code gets run anyways.