From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13848 invoked by alias); 3 May 2012 17:53:37 -0000 Received: (qmail 13839 invoked by uid 22791); 3 May 2012 17:53:36 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 17:53:23 +0000 Received: by vbbey12 with SMTP id ey12so1880564vbb.0 for ; Thu, 03 May 2012 10:53:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=WEL4TL2IxIVaO0AQJdIwO30rJYTjk4MtTfU00UC9nm4=; b=VFOk5wbkTkcRbVnr/ekGFnY6SohEl+fau/tPL6YufzGZh/6/mJ0xlcec3if3/JDmOI NCDGcO0kt9y1DG2UnrjDXGMwi4q0T7Jd6TYe6J7XcTPytDten2ym5OGl9fcgwx6f2FIB iGJigx7lLTZJd3MkRDWIemBE3VxStDutbmMwUc4K3Gmwwz4bP3P6xuQTjW6Wge7KT8Ad Egb8tA6fUn7oCnFhd9yPnNGOH1oAAWlnxhQEpxsU/tQOQVJ8kUtwnGUCJfSTH0LwIBYM 6eOV25Q8Xoh0UM3PQ53Pge/Q56kkw5SwI7f4XkFNGhTqzeIlz/bw8B3fZchd7CHNTjpQ qPrA== Received: by 10.220.141.79 with SMTP id l15mr1819187vcu.48.1336067602216; Thu, 03 May 2012 10:53:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.141.79 with SMTP id l15mr1819174vcu.48.1336067602009; Thu, 03 May 2012 10:53:22 -0700 (PDT) Received: by 10.52.165.2 with HTTP; Thu, 3 May 2012 10:53:21 -0700 (PDT) In-Reply-To: References: <20120502081647.A1B041E1374@ruffy2.mtv.corp.google.com> Date: Thu, 03 May 2012 17:53:00 -0000 Message-ID: Subject: Re: [RFC] Fix build failure in stap-probe.c. From: Doug Evans To: Sergio Durigan Junior Cc: tromey@redhat.com, jan.kratochvil@redhat.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQlW8DqBJZskUoDX1B2J1oRPtICfqCs8YR1zku2gUq/0GvkY61dD5QqlEkJq1q26Tjq/W+qz30kriqmGR+wULrwsLxMvgXYYx1z4T2fN/+pWzmlzdNeSTED88dOtAzDlbDah1CyC22lUPbgm+lPdwdvsc4kj5w== X-IsSubscribed: yes 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 X-SW-Source: 2012-05/txt/msg00096.txt.bz2 On Wed, May 2, 2012 at 11:56 AM, Sergio Durigan Junior 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 u= ninitialized in this function >> ../../src/gdb/stap-probe.c:813: note: 'lookahead_opcode' was declared he= re >> ../../src/gdb/stap-probe.c:1558: error: 'opcode' may be used uninitializ= ed 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. =A0Does this patch work for you? > > 2012-05-02 =A0Sergio Durigan Junior =A0 > > =A0 =A0 =A0 =A0* stap-probe.c (stap_is_operator): Change declaration. > =A0 =A0 =A0 =A0(stap_get_opcode): Change return value. > =A0 =A0 =A0 =A0(stap_parse_argument_1): Update calls to `stap_get_opcode'= and > =A0 =A0 =A0 =A0`stap_parse_argument_1'. Works great, thanks!