qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH v4 2/3] ppc: Drop duplicated typedefs to be able t


From: Thomas Huth
Subject: Re: [Qemu-ppc] [PATCH v4 2/3] ppc: Drop duplicated typedefs to be able to compile with Clang in gnu99 mode
Date: Fri, 11 Jan 2019 07:50:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2019-01-11 01:17, David Gibson wrote:
> On Thu, Jan 10, 2019 at 03:07:59PM +0100, Thomas Huth wrote:
>> On 2019-01-10 14:15, Greg Kurz wrote:
>>> On Thu, 10 Jan 2019 10:15:35 +0100
>>> Thomas Huth <address@hidden> wrote:
>>>
>>>> When compiling the ppc code with clang and -std=gnu99, there are a
>>>> couple of warnings/errors like this one:
>>>>
>>>>   CC      ppc64-softmmu/hw/intc/xics.o
>>>> In file included from /home/thuth/devel/qemu/hw/intc/xics.c:35:
>>>> /home/thuth/devel/qemu/include/hw/ppc/xics.h:43:25: error: redefinition of 
>>>> typedef 'ICPState' is a C11 feature
>>>>       [-Werror,-Wtypedef-redefinition]
>>>> typedef struct ICPState ICPState;
>>>>                         ^
>>>> /home/thuth/devel/qemu/target/ppc/cpu.h:1181:25: note: previous definition 
>>>> is here
>>>> typedef struct ICPState ICPState;
>>>>                         ^
>>>>
>>>> Drop the duplicated typedefs and use normal "struct" forward declarations
>>>> like we already do it at the top of spapr.h for a couple of other 
>>>> definitions.
>>>>
>>>
>>> Hmm... so the choice here is to simply ignore the official coding
>>> style ?
>>
>> Are typedefs really our "official coding style"? It's mentioned in
>> HACKING, not in CODING_STYLE, so I rather see this as a recommendation
>> only. (Otherwise, all the forward struct definitions at the beginning of
>> spapr.h are a plain violation of the coding style, too...)
> 
> I'd say it's definitely qemu coding style in practice, whatever you
> argue about the wording in the docs.

So do I get you right that you rather prefer some additional #include
statements in the headers to pull in the typedef definitions from other
headers (like Greg suggested) than to do some struct forward
declarations without typedefs?
Ok, if that's what most ppc folks prefer, I'll rework this patch
accordingly...

 Thomas

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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