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

Re: [Xen-devel] [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof



>>> On 06.10.15 at 19:25, <julien.grall@xxxxxxxxxx> wrote:
> On 05/10/15 11:31, Jan Beulich wrote:
>>>>> On 04.10.15 at 21:24, <julien.grall@xxxxxxxxxx> wrote:
>>> The keyword typeof is not portable:
>>>
>>> /usr/src/freebsd/sys/xen/hypervisor.h:93:2: error: implicit declaration
>>> of function 'typeof' is invalid in C99
>>> [-Werror,-Wimplicit-function-declaration]
>> 
>> Actually, it's worse than that - typeof() is a gcc extension, and we
>> shouldn't use extensions in public headers without at least having
>> alternative code for not gcc compatible compilers in place. In fact
>> we should probably aim at removing the exclusion of public/arch-%
>> in the ANSI conformance check; IIRC I had to add it because things
>> wouldn't build without, but with the (then forgotten) goal of dealing
>> with this properly later on.
> 
> I don't see how header.chk would have catch my issue. The problem is in
> the macro set_xen_guest_handle_raw which is not used within the headers
> (except by set_xen_guest_handle which is not used at all).
> 
> It may be worth to add a dummy .c which call the macros to check they
> are ANSI compliant.

Hmm, true, conformance of macros isn't being checked right now
(i.e. we only verify that the header as such compiles, not that
everything in the header can be used). A manually created source
would help only to some degree, as it would need to be kept up to
date with future additions. I.e. the long term solution probably
ought to be an at least partially machine generated source file. I
added this to my todo list (but towards the end of it).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.