From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lQv+HWfbql8xEwAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2020 13:26:47 -0500 Received: by simark.ca (Postfix, from userid 112) id 6C73D1F08D; Tue, 10 Nov 2020 13:26:47 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 192A11E590 for ; Tue, 10 Nov 2020 13:26:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9769C385780E; Tue, 10 Nov 2020 18:26:46 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 907D2385780E for ; Tue, 10 Nov 2020 18:26:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 907D2385780E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id EA7121E58F; Tue, 10 Nov 2020 13:26:43 -0500 (EST) Subject: Re: RFA: m32r sim: Add prototypes for functions that pass/return DI values To: Nick Clifton , dje@sebabeach.org, andrew.burgess@embecosm.com References: <87ft5hhzwo.fsf@redhat.com> From: Simon Marchi Message-ID: <682bf449-242f-8200-df3e-44cad1173ab9@simark.ca> Date: Tue, 10 Nov 2020 13:26:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <87ft5hhzwo.fsf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit 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: , Cc: gdb-patches@sourceware.org, law@redhat.com Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-11-10 12:42 p.m., Nick Clifton via Gdb-patches wrote: > Hi Doug, Hi Andrew, > > Jeff Law has tracked down a set of problems with the m32r simulator > which turned out to be because the m32rbf_h_accum_get_handler() > function returns a DI value, but it was not prototyped. So callers > would assume that it returned an int, and happiness ensued... > > I am proposing the attached patch as a workaround for the problem. A > proper fix would be to update the scheme files used to generate the > cpu headers. But I am not a scheme programmer, and besides getting > cgen to work with modern versions of guile seems to be quite > difficult. So instead the patch adds prototypes into one of the m32r > sim header files that is not auto-generated. > > OK to apply ? > > Cheers > Nick This kind of problem bit us in the past in GDB too. I'd suggest trying to make the sim build system enable any or all of these warnings to catch such problems. -Wmissing-declarations -Wmissing-prototypes -Wold-style-declaration -Wold-style-definition -Wstrict-prototypes Simon