All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Tristan Gingold <gingold@adacore.com>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] Re: [PATCH] scripts: add a guard macro in generated .h files
Date: Mon, 21 Feb 2011 09:14:30 +0100	[thread overview]
Message-ID: <4D621EE6.1030005@redhat.com> (raw)
In-Reply-To: <B6AAF2A4-F32D-4C4F-A0B8-D047917A5679@adacore.com>

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	other threads:[~2011-02-21  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 15:21 [Qemu-devel] [PATCH] scripts: add a guard macro in generated .h files Tristan Gingold
2011-02-20 18:14 ` Aurelien Jarno
2011-02-21  6:42   ` Tristan Gingold
2011-02-21  8:14     ` Paolo Bonzini [this message]
2011-02-21 18:13       ` [Qemu-devel] " Tristan Gingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D621EE6.1030005@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=gingold@adacore.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.