Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Yao Qi <yao@codesourcery.com>, gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [patch+7.8?] Fix --with-babeltrace with gcc-4.9.1
Date: Tue, 12 Aug 2014 20:33:00 -0000	[thread overview]
Message-ID: <CADPb22S-e=fR9DCHQwMPaoKoTMfjjLk2C5_h3m5VJMBAXEE8Pg@mail.gmail.com> (raw)
In-Reply-To: <20140812192204.GA13299@host2.jankratochvil.net>

On Tue, Aug 12, 2014 at 12:22 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> 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  <yao@codesourcery.com>
>
>         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.


  reply	other threads:[~2014-08-12 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 20:38 [patch] " Jan Kratochvil
2014-08-04 23:37 ` Doug Evans
2014-08-06  1:04 ` Yao Qi
2014-08-12 19:22   ` [patch+7.8?] " Jan Kratochvil
2014-08-12 20:33     ` Doug Evans [this message]
2014-08-12 20:38       ` Jan Kratochvil
2014-08-12 21:28         ` Doug Evans
2014-08-13  1:54       ` Yao Qi
2014-08-13  3:05         ` Doug Evans
2014-08-13  9:52           ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADPb22S-e=fR9DCHQwMPaoKoTMfjjLk2C5_h3m5VJMBAXEE8Pg@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox