autoconf
[Top][All Lists]
Advanced

[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 2.0.0.12 (X11/20080226)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaragon,

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 config.h.in 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.

Regards,
John
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIKboUdcgqmRY/OH8RApL7AJ9GQ68IUr5Ws+FCrwvIbRE3FmTXBwCfa9p9
EQCTsYdLYFbj1DGYdfCZl6c=
=BP5Z
-----END PGP SIGNATURE-----




reply via email to

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