From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 30/34] xen: Add missing includes on different files Date: Tue, 01 Apr 2014 18:58:57 +0100 Message-ID: <533AFE61.2000704@linaro.org> References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> <1395766541-23979-31-git-send-email-julien.grall@linaro.org> <1395940318.22909.223.camel@kazak.uk.xensource.com> <53346019.60605@linaro.org> <1395941997.22909.235.camel@kazak.uk.xensource.com> <53346443.4020808@linaro.org> <1396000744.22909.258.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WV2xh-0006cl-EA for xen-devel@lists.xenproject.org; Tue, 01 Apr 2014 17:59:01 +0000 Received: by mail-wi0-f180.google.com with SMTP id q5so5667351wiv.1 for ; Tue, 01 Apr 2014 10:58:59 -0700 (PDT) In-Reply-To: <1396000744.22909.258.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, Daniel De Graaf , tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 03/28/2014 09:59 AM, Ian Campbell wrote: > On Thu, 2014-03-27 at 17:47 +0000, Julien Grall wrote: >> On 03/27/2014 05:39 PM, Ian Campbell wrote: >>> On Thu, 2014-03-27 at 17:30 +0000, Julien Grall wrote: >>>> On 03/27/2014 05:11 PM, Ian Campbell wrote: >>>>> On Tue, 2014-03-25 at 16:55 +0000, Julien Grall wrote: >>>>>> This was spotted by -Wmissing-prototypes, which we can't enable because there >>>>>> is exported function for assembly. I'm not sure if we need to add a prototype >>>>>> for them. >>>>> >>>>> What exactly is the issue here? >>>> >>>> There a bunch of functions (see below for ARM) where the prototype is >>>> not defined before. Mainly because theses functions are used by the >>>> assembly code so we don't need to give a prototype. >>>> >>>> do_trap_* >>>> start_xen >>>> start_secondary >>>> leave_hypervisor_tail >>> >>> Is that all of them? Although their prototypes are useless there are few >>> enough of them that the benefit of being able to turn on >>> Wmissing-prototypes might make it worth it. >> >> From the common code there is 7 others: >> >> core_parking_helper and get_cur_idle_nums (both of them are used on C >> code but never defined in an header. I was lazy and I didn't write a patch). >> >> __qdivrem >> __divdi3 >> __umoddi3 >> __moddi3 >> __ldivmod_helper > > Still not awful I guess. > > Several of these are essentially library functions provided for the > compiler to emit calls to, I wonder if there is some compiler header > which we should be including which would prototype them. Probably not, > worth a look though. These functions are not used by x86 (because of the if BITS_PER_LONG == 32), and on ARM we provide eabi_* helpers. >> >> For x86, I didn't yet try to compiled it with -Wmissing-prototypes. >> >>> >>> Unless there is some attribute we can apply which marks these as not >>> requiring a prototype? >> >> I will look at it. > > Thanks. > >>> Even better if as a side effect the compiler will >>> warn about calls not from assembly... >> >> I would love to see this feature, but I don't think the linker is able >> to differentiate call from C and from assembly :). > > The compiler could see a call from C code to a function whose prototype > was marked with "called_from_asm_only". I'm afraid there is no __attribute__ feature for a such thing. One solution could be introduce mismatch section as Linux (e.g: functions called from assembly are in a specific section). Regards, -- Julien Grall