From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id 26ACA3851C04 for ; Sun, 31 May 2020 07:20:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 26ACA3851C04 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@gnu.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id A0A332407; Sun, 31 May 2020 09:20:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MT5LKQFXGmHJ; Sun, 31 May 2020 09:20:33 +0200 (CEST) Received: from function (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 514EC1957; Sun, 31 May 2020 09:20:33 +0200 (CEST) Received: from samy by function with local (Exim 4.93) (envelope-from ) id 1jfIGm-00BRub-1j; Sun, 31 May 2020 09:20:32 +0200 Date: Sun, 31 May 2020 09:20:32 +0200 From: Samuel Thibault To: Simon Marchi Cc: gdb-patches@sourceware.org, Thomas Schwinge , thomas@schwinge.name, bug-hurd@gnu.org Subject: Re: [PATCH] hurd: Add shared mig declarations Message-ID: <20200531072032.hfegxapkqv3a3hrb@function> Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org, Thomas Schwinge , thomas@schwinge.name, bug-hurd@gnu.org References: <20200530182318.hh3k7uuhvhfrqo5g@function> <3ec177fc-e9b6-42a0-0aa9-3cec13e9a577@simark.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3ec177fc-e9b6-42a0-0aa9-3cec13e9a577@simark.ca> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=no 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 07:20:39 -0000 Simon Marchi, le sam. 30 mai 2020 21:51:35 -0400, a ecrit: > 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. I have now added “ We are using -Werror=missing-declarations, and the _S.h files generated by mig do not currently include a declaration for the server routine. gnu-nat.c used to have its own external declarations, but better just share them between gnu-nat.c and the _S.c files. ” > 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? Mig does include declarations for the functions of the .c files, but not for the server routine, I don't know why that was never implemented there (this hasn't been touched since the VCS initial import). Samuel