From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2B60F387102D for ; Sun, 31 May 2020 01:51:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2B60F387102D 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 5F9541E072; Sat, 30 May 2020 21:51:36 -0400 (EDT) Subject: Re: [PATCH] hurd: Add shared mig declarations To: gdb-patches@sourceware.org, Thomas Schwinge , thomas@schwinge.name, bug-hurd@gnu.org References: <20200530182318.hh3k7uuhvhfrqo5g@function> From: Simon Marchi Message-ID: <3ec177fc-e9b6-42a0-0aa9-3cec13e9a577@simark.ca> Date: Sat, 30 May 2020 21:51:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200530182318.hh3k7uuhvhfrqo5g@function> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Sun, 31 May 2020 01:51:44 -0000 On 2020-05-30 2:23 p.m., Samuel Thibault wrote: > Fixes > > exc_request_S.c:177:24: error: no previous declaration for ‘exc_server’ [-Werror=missing-declarations] > 177 | mig_external boolean_t exc_server > > gdb/ChangeLog: > > * config/i386/i386gnu.mn [%_S.o %_U.o] (COMPILE.post): Add > "-include gnu-nat-mig.h". > * gnu-nat-mig.h: New file. > * gnu-nat.c: Include "gnu-nat-mig.h". > (exc_server, msg_reply_server, notify_server, > process_reply_server): Remove declarations. It took me a while to understand the underlying problem. My understanding is that gnu-nat.c calls this function exc_server, that is defined in the generated file. The generated file does not provide a header with declarations, so gnu-nat.c had its own local declaration. Since we now use the -Wmissing-declarations warning flag, and the definition in the generated exc_request_S.c didn't see a corresponding declaration, it caused that build failure. Is that correct? If so, please add that explanation or equivalent to the commit log. My question now is: that MIG tool appears to generate both a header (%_S.h) and source file (%_S.c) from defs files. What is this header file used for, if it doesn't contain the declaration for the functions in the source file? Simon