From: Doug Evans <dje@google.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: tromey@redhat.com, jan.kratochvil@redhat.com, gdb-patches@sourceware.org
Subject: Re: [RFC] Fix build failure in stap-probe.c.
Date: Thu, 03 May 2012 17:53:00 -0000 [thread overview]
Message-ID: <CADPb22TYvoC4ODX9=U93b+81onVOq-6gM7C0tBFCDBKuaPTTbg@mail.gmail.com> (raw)
In-Reply-To: <m3aa1qza20.fsf@redhat.com>
On Wed, May 2, 2012 at 11:56 AM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> On Wednesday, May 02 2012, Doug Evans wrote:
>
>> Hi.
>>
>> I'm getting build failures, gcc is complaining that "opcode" and
>> "lookahead_opcode" "may be used uninitialized".
>
> Hi Doug,
>
> I'm not seeing this error when I compile (even with -O2), but I believe
> you :-).
>
>> cc1: warnings being treated as errors
>> ../../src/gdb/stap-probe.c: In function 'stap_parse_argument_1':
>> ../../src/gdb/stap-probe.c:1558: error: 'lookahead_opcode' may be used uninitialized in this function
>> ../../src/gdb/stap-probe.c:813: note: 'lookahead_opcode' was declared here
>> ../../src/gdb/stap-probe.c:1558: error: 'opcode' may be used uninitialized in this function
>> ../../src/gdb/stap-probe.c:778: note: 'opcode' was declared here
>> make: *** [stap-probe.o] Error 1
>>
>> This patch is just RFC.
>> IIUC the code already watches for valid operators before
>> calling stap_get_opcode, so stap_get_opcode should "never" return zero.
>> So I'm wondering if maybe step_get_opcode should be changed
>> to always succeed and always set the opcode.
>
> You're right. Does this patch work for you?
>
> 2012-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * stap-probe.c (stap_is_operator): Change declaration.
> (stap_get_opcode): Change return value.
> (stap_parse_argument_1): Update calls to `stap_get_opcode' and
> `stap_parse_argument_1'.
Works great, thanks!
next prev parent reply other threads:[~2012-05-03 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 8:17 Doug Evans
2012-05-02 18:56 ` Sergio Durigan Junior
2012-05-03 17:53 ` Doug Evans [this message]
2012-05-03 20:05 ` Sergio Durigan Junior
2012-05-03 20:27 ` Doug Evans
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='CADPb22TYvoC4ODX9=U93b+81onVOq-6gM7C0tBFCDBKuaPTTbg@mail.gmail.com' \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=sergiodj@redhat.com \
--cc=tromey@redhat.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