From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LpnlV-0007uh-5t for qemu-devel@nongnu.org; Fri, 03 Apr 2009 14:05:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LpnlQ-0007s0-LS for qemu-devel@nongnu.org; Fri, 03 Apr 2009 14:05:16 -0400 Received: from [199.232.76.173] (port=53986 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LpnlQ-0007rx-Gv for qemu-devel@nongnu.org; Fri, 03 Apr 2009 14:05:12 -0400 Received: from rv-out-0708.google.com ([209.85.198.241]:15731) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LpnlP-0002JE-Rf for qemu-devel@nongnu.org; Fri, 03 Apr 2009 14:05:12 -0400 Received: by rv-out-0708.google.com with SMTP id k29so486300rvb.2 for ; Fri, 03 Apr 2009 11:05:10 -0700 (PDT) Message-ID: <49D64FD2.4080003@codemonkey.ws> Date: Fri, 03 Apr 2009 13:05:06 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] Introduce module API to QEMU References: <49D60814.9020703@codemonkey.ws> <49D6480F.2000408@codemonkey.ws> <20090403.115843.84364240.imp@bsdimp.com> In-Reply-To: <20090403.115843.84364240.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "M. Warner Losh" Cc: qemu-devel@nongnu.org, paul@codesourcery.com M. Warner Losh wrote: > In message: <49D6480F.2000408@codemonkey.ws> > Anthony Liguori writes: > : malc wrote: > : > You are using _identifier_ whose name violates 7.1.3, full stop, you > : > can not do that in _any_ context. > : > > : > : So then we cannot use __func__ either or __attribute__ by your logic. > > No. That's not true. Those are defined by the standard or by the > implementation. he's objecting to your using an identifier that > starts with __ when really, there's no reason to do that. > The identifier is defined by the *implementation*. That's the whole point. When you use the __attribute__((section,"FOO")), it forces the variable to be in section FOO. For all sections, the linker (IOW the *implementation*) creates two variables named __start_SECTION and __stop_SECTION. In this case, it's __start_FOO and __stop_FOO. You have to *declare* this variable yourself because the linker is not the frontend and the frontend doesn't know about these variables. The linker is what *defines* these variables. It doesn't matter because I've switched to __attribute__((constructor)), but this is not a violation of the standard. You cannot rename these variables because you have no control over the definition. They are there whether you like them or not. Regards, Anthony Liguori > Warner >