From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12144 invoked by alias); 28 Apr 2006 15:01:49 -0000 Received: (qmail 12136 invoked by uid 22791); 28 Apr 2006 15:01:48 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-04.spheriq.net (HELO lon-del-04.spheriq.net) (195.46.50.101) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 28 Apr 2006 15:01:46 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-04.spheriq.net with ESMTP id k3SF1gxK010388 for ; Fri, 28 Apr 2006 15:01:42 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-03.spheriq.net with ESMTP id k3SF1gDc009058 for ; Fri, 28 Apr 2006 15:01:42 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-02.spheriq.net with ESMTP id k3SF1eSO016060 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Fri, 28 Apr 2006 15:01:41 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 85D1BDA41 for ; Fri, 28 Apr 2006 15:01:40 +0000 (GMT) Received: from mail2.gnb.st.com (mail2.gnb.st.com [164.129.119.59]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0DA3E475D3 for ; Fri, 28 Apr 2006 15:01:39 +0000 (GMT) Received: from [164.129.122.218] (gnx2364.gnb.st.com [164.129.122.218]) by mail2.gnb.st.com (MOS 3.5.8-GR) with ESMTP id CHG44194 (AUTH lyon); Fri, 28 Apr 2006 17:01:38 +0200 (CEST) Message-ID: <44522E52.9080706@st.com> Date: Fri, 28 Apr 2006 15:01:00 -0000 From: Christophe LYON User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [RFC] Unused variables in testsuite Content-Type: multipart/mixed; boundary="------------030900030400050307090405" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00365.txt.bz2 This is a multi-part message in MIME format. --------------030900030400050307090405 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 149 Hi all, Following my message on the "gdb" list (http://sources.redhat.com/ml/gdb/2006-04/msg00327.html), here is the patch I propose. Christophe. --------------030900030400050307090405 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" Content-length: 1426 2006-04-28 Christophe Lyon * gdb.cp/m-static.h (class gnu_obj_4): Add dummy member. * gdb.cp/m-static.cc (main): Write to test4.dummy, so that test4 is allocated by the compiler. * gdb.mi/var-cmd.c: (do_special_tests): Write to u, anonu, s, anons, e, anone to force their allocation by the compiler. Index: gdb.cp/m-static.cc =================================================================== --- gdb.cp/m-static.cc (revision 96) +++ gdb.cp/m-static.cc (working copy) @@ -68,5 +68,6 @@ int main() gnu_obj_3 test3(greek); gnu_obj_4 test4; - return 0; // breakpoint: constructs-done + test4.dummy = 0; + return test4.dummy; // breakpoint: constructs-done } Index: gdb.cp/m-static.h =================================================================== --- gdb.cp/m-static.h (revision 96) +++ gdb.cp/m-static.h (working copy) @@ -7,5 +7,8 @@ class gnu_obj_4 static const int nowhere; // At some point, perhaps: // static const int everywhere = 317; + + // try to ensure test4 is actually allocated + int dummy; }; Index: gdb.mi/var-cmd.c =================================================================== --- gdb.mi/var-cmd.c (revision 96) +++ gdb.mi/var-cmd.c (working copy) @@ -301,6 +301,12 @@ do_special_tests (void) int a; a = 1; + u.integer = a; + anonu.a = a; + s.integer = a; + anons.a = a; + e = bar; + anone = A; incr_a(2); } --------------030900030400050307090405--