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 <th...@redhat.com> 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