From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 358 invoked by alias); 12 Jan 2010 07:56:41 -0000 Received: (qmail 340 invoked by uid 22791); 12 Jan 2010 07:56:41 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jan 2010 07:56:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id ADC5E40E52 for ; Tue, 12 Jan 2010 02:56:34 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Nshfe2zROtbN for ; Tue, 12 Jan 2010 02:56:34 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3413A40E53 for ; Tue, 12 Jan 2010 02:56:34 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id ED595F595E; Tue, 12 Jan 2010 11:56:19 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [commit] Fix -Wunused warning in dec-thread.c. Date: Tue, 12 Jan 2010 07:56:00 -0000 Message-Id: <1263282971-16934-1-git-send-email-brobecker@adacore.com> 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: 2010-01/txt/msg00292.txt.bz2 From: brobecke Hello, The compiler complains that the result of a couple of *PTR++ is never used. This is because the compiler is tricked by the way the pointer was defined. For instance: | dec_thread_count_gdb_threads (struct thread_info *ignored, void *context) | { | int *count = (int *) context; The compiler complains that the result is never used for the following line: | *count++; The result is stored for the caller to use, so it is in fact potentially used, but elsewhere... gdb/ChangeLog: * dec-thread.c (dec_thread_count_gdb_threads) (dec_thread_add_gdb_thread): Prevent -Wunused warning. Checked in. --- gdb/dec-thread.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c index 5083221..be6db4c 100644 --- a/gdb/dec-thread.c +++ b/gdb/dec-thread.c @@ -352,7 +352,7 @@ dec_thread_count_gdb_threads (struct thread_info *ignored, void *context) { int *count = (int *) context; - *count++; + (void) *count++; /* The cast to void is to prevent a -Wunused warning. */ return 0; } @@ -366,7 +366,7 @@ dec_thread_add_gdb_thread (struct thread_info *info, void *context) struct thread_info ***listp = (struct thread_info ***) context; **listp = info; - *listp++; + (void) *listp++; /* The cast to void is to prevent a -Wunused warning. */ return 0; } -- 1.6.3.3