[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] scripts: add a guard macro in generated .h file
From: |
Tristan Gingold |
Subject: |
[Qemu-devel] Re: [PATCH] scripts: add a guard macro in generated .h files |
Date: |
Mon, 21 Feb 2011 19:13:11 +0100 |
On Feb 21, 2011, at 9:14 AM, Paolo Bonzini wrote:
> On 02/21/2011 07:42 AM, Tristan Gingold wrote:
>> Mostly a style issue. It is common to always protect header files
>> against multiple inclusion, unless the header is meant to be included
>> several times (which is not the case for these config files). I
>> think this is a good practice.
>
> Traditionally, autoconf's config.h headers have no guards either. This can
> indeed cause some troubles. However, it also helps highlighting poor
> practices, such as libraries installing a config.h file including it from a
> public header.
>
>> I once got redefinition warnings for macros in config-host.h, but I
>> agree that adding the guard macro doesn't fix this issue.
>
> config-host.h should always be the first included header (we are poor at
> this) and its macros should never conflict with anything else. I think we
> should rather fix the problems you've seen with config-host.h, if you can
> still reproduce them.
Thank you. I will investigate the next time I have the issue and the time.
Tristan.