[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #define warnings when using various autotools projects

From: John Calcote
Subject: Re: #define warnings when using various autotools projects
Date: Tue, 13 May 2008 09:56:04 -0600
User-agent: Thunderbird (X11/20080226)

Hash: SHA1


aaragon wrote:
> Hi everyone,
> A project of mine uses two autotools projects, each of which creates a
> config.h file where there are a bunch of #define statements. Well, when I
> compile I see several warning messages telling me that some of those
> variables are re-defined. What is the cleanest way to fix this? I could just
> rename those #define statements to something else in any of the config.h
> files but I don't think that is the way to do this. Besides, those files are
> generated from a that had been generated by autoheader.

If I understand what's happening, I believe you're saying that you have
a project that uses *libraries and headers* from two Autotools projects.
It appears that as you include these header files, you're having to
include two different unrelated config.h files. Is that correct?

Assuming this is what you mean, then here's the problem. The two
Autotools projects are written incorrectly. A generated config.h header
file should NEVER be found in the public interface of a library. The
reasons for this are now obvious to you, because you're having to deal
with the backlash of the problem.

But this is very common mistake. It comes from carelessness about which
header files are considered part of the public interface, and which ones
should be kept private. The generated config.h header file is intended
to help BUILD the library on a particular platform, not provide support
for consumers of the library through the public interface of that
library. And yet I see this happen all the time.

Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE -


reply via email to

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