From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 1AE0F385E007 for ; Thu, 20 May 2021 11:59:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1AE0F385E007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 17991ABCD; Thu, 20 May 2021 11:59:35 +0000 (UTC) Subject: Re: [PATCH] sim: ppc: fix some Wpointer-sign warnings To: gdb-patches@sourceware.org, andrew.burgess@embecosm.com References: <20210519104646.GA11845@delia> From: Tom de Vries Message-ID: <4a3cbd46-ce48-44f5-7d82-309c6257c8df@suse.de> Date: Thu, 20 May 2021 13:59:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------2A4FB51173F9A5A39200F8AD" Content-Language: en-US X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 11:59:37 -0000 This is a multi-part message in MIME format. --------------2A4FB51173F9A5A39200F8AD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 5/19/21 6:32 PM, Mike Frysinger wrote: > On 19 May 2021 12:46, Tom de Vries wrote: >> --- a/sim/ppc/hw_memory.c >> +++ b/sim/ppc/hw_memory.c >> @@ -190,7 +190,7 @@ hw_memory_init_address(device *me) >> if (device_find_property(me, "available") != NULL) { >> hw_memory_chunk **curr_chunk = &hw_memory->heap; >> int cell_nr; >> - unsigned_cell dummy; >> + signed_cell dummy; >> int nr_cells = device_find_integer_array_property(me, "available", 0, &dummy); > > this one is fine > Committed separately, as attached. Thanks, - Tom --------------2A4FB51173F9A5A39200F8AD Content-Type: text/x-patch; charset=UTF-8; name="0001-sim-ppc-fix-Wpointer-sign-warning.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-sim-ppc-fix-Wpointer-sign-warning.patch" sim: ppc: fix Wpointer-sign warning When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into: ... src/sim/ppc/hw_memory.c: In function 'hw_memory_init_address': src/sim/ppc/hw_memory.c:194:75: error: pointer targets in passing \ argument 4 of 'device_find_integer_array_property' differ in signedness \ [-Werror=pointer-sign] int nr_cells = device_find_integer_array_property(me, "available", 0, &dummy); ^ ... Fix this by changing the type of dummy. --- sim/ppc/hw_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/ppc/hw_memory.c b/sim/ppc/hw_memory.c index 09c331c3295..46b22f7b6e3 100644 --- a/sim/ppc/hw_memory.c +++ b/sim/ppc/hw_memory.c @@ -190,7 +190,7 @@ hw_memory_init_address(device *me) if (device_find_property(me, "available") != NULL) { hw_memory_chunk **curr_chunk = &hw_memory->heap; int cell_nr; - unsigned_cell dummy; + signed_cell dummy; int nr_cells = device_find_integer_array_property(me, "available", 0, &dummy); if ((nr_cells % 2) != 0) device_error(me, "property \"available\" invalid - contains an odd number of cells"); --------------2A4FB51173F9A5A39200F8AD--