From patchwork Wed Nov 5 06:07:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 3584 Received: (qmail 5751 invoked by alias); 5 Nov 2014 06:07:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5739 invoked by uid 89); 5 Nov 2014 06:07:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f42.google.com Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Nov 2014 06:07:38 +0000 Received: by mail-pa0-f42.google.com with SMTP id bj1so108006pad.15 for ; Tue, 04 Nov 2014 22:07:37 -0800 (PST) X-Received: by 10.70.130.174 with SMTP id of14mr3493889pdb.90.1415167657193; Tue, 04 Nov 2014 22:07:37 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-155-134.oycza5.sa.bigpond.net.au. [58.160.155.134]) by mx.google.com with ESMTPSA id rh5sm2104319pdb.4.2014.11.04.22.07.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Nov 2014 22:07:36 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id C0D4CEA5E3D; Wed, 5 Nov 2014 16:37:29 +1030 (ACDT) Date: Wed, 5 Nov 2014 16:37:29 +1030 From: Alan Modra To: gdb-patches@sourceware.org Subject: Cast result of obstack_next_free Message-ID: <20141105060729.GB30857@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) obstack_next_free is supposed to return a void*, rather than a char* as it does currently. Avoid warning on void* arithmetic when obstack_next_free gets it proper return type. Committing as obvious. * cp-valprint.c (cp_print_value_fields): Cast obstack_next_free to char* before doing pointer arithmetic. diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 42010c2..8f456bf 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -370,7 +370,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, /* In effect, a pop of the printed-statics stack. */ void *free_to_ptr = - obstack_next_free (&dont_print_statmem_obstack) - + (char *) obstack_next_free (&dont_print_statmem_obstack) - (obstack_final_size - statmem_obstack_initial_size); obstack_free (&dont_print_statmem_obstack, @@ -385,7 +385,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, if (obstack_final_size > stat_array_obstack_initial_size) { void *free_to_ptr = - obstack_next_free (&dont_print_stat_array_obstack) + (char *) obstack_next_free (&dont_print_stat_array_obstack) - (obstack_final_size - stat_array_obstack_initial_size);