From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14732 invoked by alias); 17 Mar 2008 14:11:05 -0000 Received: (qmail 14719 invoked by uid 22791); 17 Mar 2008 14:11:04 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Mar 2008 14:10:36 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m2HEAXR1203800 for ; Mon, 17 Mar 2008 14:10:33 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m2HEAXvq2027608 for ; Mon, 17 Mar 2008 15:10:33 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m2HEAWej008783 for ; Mon, 17 Mar 2008 15:10:33 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m2HEAWtC008777; Mon, 17 Mar 2008 15:10:32 +0100 Message-Id: <200803171410.m2HEAWtC008777@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 17 Mar 2008 15:10:32 +0100 Subject: [commit] Fix compile error (Re: [RFA] Async mode fixes.) To: vladimir@codesourcery.com (Vladimir Prus) Date: Mon, 17 Mar 2008 14:11:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sources.redhat.com In-Reply-To: <200803051027.29575.vladimir@codesourcery.com> from "Vladimir Prus" at Mar 05, 2008 10:27:28 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-03/txt/msg00226.txt.bz2 Vladimir Prus wrote: > + long time_at_cmd_start; [snip] > + if (target_can_async_p ()) > + { > + time_at_cmd_start = get_run_time (); [snip] > + if (target_can_async_p () && target_executing) > + { > + arg1 = > + (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); > + arg2 = > + (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); > + arg1->next = arg2; > + arg2->next = NULL; > + arg1->data.longint = time_at_cmd_start; this breaks compilation with: /home/uweigand/fsf/gdb-head/gdb/top.c: In function `execute_command': /home/uweigand/fsf/gdb-head/gdb/top.c:415: warning: 'time_at_cmd_start' might be used uninitialized in this function and the compiler error seems somewhat justified as the compiler cannot know that target_can_async_p () always returns the same value ... Fixed by adding a dummy initializer, as already done for space_at_cmd_start. Committed to mainline. Bye, Ulrich ChangeLog: * top.c (execute_command): Fix uninitialized variable error. Index: gdb/top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.133 diff -u -p -r1.133 top.c --- gdb/top.c 14 Mar 2008 18:57:43 -0000 1.133 +++ gdb/top.c 17 Mar 2008 13:54:19 -0000 @@ -412,7 +412,7 @@ execute_command (char *p, int from_tty) char *line; struct continuation_arg *arg1; struct continuation_arg *arg2; - long time_at_cmd_start; + long time_at_cmd_start = 0; #ifdef HAVE_SBRK long space_at_cmd_start = 0; #endif -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com