qemu-devel
[Top][All Lists]
Advanced

[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: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH] scripts: add a guard macro in generated .h files
Date: Mon, 21 Feb 2011 09:14:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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.

Paolo



reply via email to

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