[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Introduce module API to QEMU

From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] Introduce module API to QEMU
Date: Fri, 03 Apr 2009 13:05:06 -0500
User-agent: Thunderbird (X11/20090320)

M. Warner Losh wrote:
In message: <address@hidden>
            Anthony Liguori <address@hidden> 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.


Anthony Liguori


reply via email to

[Prev in Thread] Current Thread [Next in Thread]