From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22203 invoked by alias); 26 Dec 2008 18:56:04 -0000 Received: (qmail 22195 invoked by uid 22791); 26 Dec 2008 18:56:03 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Dec 2008 18:55:27 +0000 Received: (qmail 17059 invoked from network); 26 Dec 2008 18:55:25 -0000 Received: from unknown (HELO bullfrog.localdomain) (sandra@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Dec 2008 18:55:25 -0000 Message-ID: <49552887.7080800@codesourcery.com> Date: Fri, 26 Dec 2008 18:56:00 -0000 From: Sandra Loosemore User-Agent: Thunderbird 2.0.0.4 (X11/20070604) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: RFA: fix compilation warning Content-Type: multipart/mixed; boundary="------------010308020504010909050404" 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: 2008-12/txt/msg00413.txt.bz2 This is a multi-part message in MIME format. --------------010308020504010909050404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 201 I attempted to do a fresh checkout and build just now, and found it was failing with a variable-maybe-used-uninitialized compiler diagnostic. The attached patch fixes it. OK to check in? -Sandra --------------010308020504010909050404 Content-Type: text/x-log; name="gdb-compile.log" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-compile.log" Content-length: 137 2008-12-26 Sandra Loosemore gdb/ * breakpoint.c (update_watchpoint): Refactor to avoid compiler warning. --------------010308020504010909050404 Content-Type: text/x-patch; name="gdb-compile.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-compile.patch" Content-length: 1269 Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.367 diff -u -r1.367 breakpoint.c --- gdb/breakpoint.c 22 Dec 2008 04:37:37 -0000 1.367 +++ gdb/breakpoint.c 26 Dec 2008 18:47:54 -0000 @@ -898,19 +898,23 @@ if ((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) && reparse) { - int i, mem_cnt, target_resources_ok, other_type_used; + int i, mem_cnt, other_type_used; i = hw_watchpoint_used_count (bp_hardware_watchpoint, &other_type_used); mem_cnt = can_use_hardware_watchpoint (val_chain); - if (mem_cnt) - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT - (bp_hardware_watchpoint, i + mem_cnt, other_type_used); - if (!mem_cnt || target_resources_ok <= 0) + if (!mem_cnt) b->type = bp_watchpoint; else - b->type = bp_hardware_watchpoint; + { + int target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT + (bp_hardware_watchpoint, i + mem_cnt, other_type_used); + if (target_resources_ok <= 0) + b->type = bp_watchpoint; + else + b->type = bp_hardware_watchpoint; + } } /* Look at each value on the value chain. */ --------------010308020504010909050404--