From patchwork Sat Nov 7 08:11:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 541231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AF7151409A0 for ; Sat, 7 Nov 2015 19:11:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qlxhc/mX; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type :content-transfer-encoding:in-reply-to; q=dns; s=default; b=MDe1 LeMbU/1YeKQF7mwQEEVVHBfeKXyRpiXvykuJClLF1YOUD0aR9La4G6mG9SYt/uM1 Vyze5ErYdWhHZODoEkV9io3qG//6/1YV8hWiFS7R/EsQEKe94WN3nXql6l44wmqK bRkmDsEKJ0T1AS/lGkW/pf07VFHR41EhVuWJECE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type :content-transfer-encoding:in-reply-to; s=default; bh=N05hON50Gn Gz6wzEOF4Q5BqeqEY=; b=qlxhc/mXwF1Gc7gSxvGH6VyEkgaXotzUaDqZ6cVT/I G/1o1VaU6xFvqZEfoByEuIFqcBAcyOPRp/VLrLPe8WriD0iCvVPEkklwaClcXJiV A516M/4ZKwjkt50K/Snogjh6L1lFdVvLrvHo7Yka71EbzDvyNJkgVq/ZDaHEtVEl k= Received: (qmail 14728 invoked by alias); 7 Nov 2015 08:11:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 14710 invoked by uid 89); 7 Nov 2015 08:11:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_40, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 07 Nov 2015 08:11:27 +0000 Received: by pacdm15 with SMTP id dm15so121797275pac.3 for ; Sat, 07 Nov 2015 00:11:26 -0800 (PST) X-Received: by 10.66.219.39 with SMTP id pl7mr23895109pac.88.1446883886024; Sat, 07 Nov 2015 00:11:26 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-163-67.gqzg1.fli.bigpond.net.au. [58.160.163.67]) by smtp.gmail.com with ESMTPSA id yn8sm4017075pac.32.2015.11.07.00.11.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2015 00:11:25 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 23592EA1530; Sat, 7 Nov 2015 18:41:22 +1030 (ACDT) Date: Sat, 7 Nov 2015 18:41:22 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Subject: [PATCH 6/7] Silence obstack.c -Wc++compat warning Message-ID: <20151107081121.GG17177@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151107080609.GA17177@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Fixes warning: request for implicit conversion from ‘void *’ to ‘struct _obstack_chunk *’ not permitted in C++ [-Wc++-compat] I moved the assignment to h->chunk to fix an overlong line, then decided it would be better after the alloc failure check just to do things the same way as in _obstack_newchunk. * obstack.c (_obstack_newchunk): Silence -Wc++compat warning. (_obstack_begin_worker): Likewise. Move assignment to h->chunk after alloc failure check. diff --git a/libiberty/obstack.c b/libiberty/obstack.c index 9f34da1..6d8d672 100644 --- a/libiberty/obstack.c +++ b/libiberty/obstack.c @@ -138,9 +138,10 @@ _obstack_begin_worker (struct obstack *h, h->chunk_size = size; h->alignment_mask = alignment - 1; - chunk = h->chunk = call_chunkfun (h, h->chunk_size); + chunk = (struct _obstack_chunk *) call_chunkfun (h, h->chunk_size); if (!chunk) (*obstack_alloc_failed_handler) (); + h->chunk = chunk; h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, alignment - 1); h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; @@ -202,7 +203,7 @@ _obstack_newchunk (struct obstack *h, _OBSTACK_SIZE_T length) /* Allocate and initialize the new chunk. */ if (obj_size <= sum1 && sum1 <= sum2) - new_chunk = call_chunkfun (h, new_size); + new_chunk = (struct _obstack_chunk *) call_chunkfun (h, new_size); if (!new_chunk) (*obstack_alloc_failed_handler)(); h->chunk = new_chunk;