public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Ulf Hermann <ulf.hermann@qt.io>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH] Avoid double-including config.h
Date: Tue, 02 May 2017 21:59:00 -0000	[thread overview]
Message-ID: <1493725744.31726.157.camel@klomp.org> (raw)
In-Reply-To: <5ee0f1d0-f5be-29d2-6c7c-d1fcae93003c@qt.io>

On Thu, 2017-04-20 at 16:31 +0200, Ulf Hermann wrote:
> config.h doesn't have include guards, so including it twice is bad. We
> deal with this by checking for PACKAGE_NAME, but only in some places.
> Once we start using gnulib, we will need to include config.h before any
> gnulib-generated headers. This is problematic if we include it
> transitively through our own private headers.
> 
> In order to set a clear rule about inclusion of config.h, it is now
> included in every .c file as first header, but not in any header. This
> will definitely avoid double-inclusion and satisfy the condition that it
> has to be included before gnulib headers. It comes at the price of
> adding some redundancy, but there is no clean way to avoid this.

It seems a clear rule that is easy to follow. The only exceptions are
the crc32.c file which gets included itself and the
linux-kernel-modules.c which needs the ugly BAD_FTS check before
config.h (which your patch both handles). Maybe we can cleanup that last
one once we integrate gnulib (which I believe has a good/64-off_t fts.h
already).

Applied to master.

Thanks,

Mark

  reply	other threads:[~2017-05-02 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 14:31 Ulf Hermann
2017-05-02 21:59 ` Mark Wielaard [this message]
2017-05-02 22:30   ` Ulf Hermann
2017-05-04  9:27     ` Ulf Hermann

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=1493725744.31726.157.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=ulf.hermann@qt.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).