Can we include "includes" a little later?
abartlet at samba.org
Fri Dec 7 12:50:11 MST 2012
On Fri, 2012-12-07 at 09:09 -0800, Richard Sharpe wrote:
> Hi folks,
> In our build there are lots of instances of these warnings:
> warning: "PRIi64" redefined
> In file included from include/includes.h:23,
> from libnet/libnet_dssync_keytab.c:21:
> ./../lib/replace/../replace/replace.h:91:1: warning: this is the
> location of the previous definition
> In file included from
> from include/smb_krb5.h:36,
> from libnet/libnet_dssync_keytab.c:22:
> These come about because we include includes.h before smb_krb5.conf in
> #include "includes.h"
> #include "smb_krb5.h"
> #include "ads.h"
> #include "libnet/libnet_dssync.h"
> #include "libnet/libnet_keytab.h"
> #include "librpc/gen_ndr/ndr_drsblobs.h"
> includes.h pulls in replace.h which defines all those PRIxxx things
> before the system includes that get pulled in by smb_krb5.h.
> It sure would remove a lot of useless noise warnings if we changed the
> order of includes ...
No, it would just cause other problems.
If the current includes.h cause problems, we need to do one of two
- Include less in "includes.h" (something we have been trying to do for
- Fix the re-definition.
In this case, as we always include replace.h early, it needs to include
any headers required to correctly (rather than by replacement) define
things like PRIi64. And indeed it does:
/* force off HAVE_INTTYPES_H so that roken doesn't try to include both,
which causes a warning storm on irix */
So, what you really need to do is work out why this #ifdef block is not
correct, stdint.h doesn't define these, or why you don't have inttypes.h
at configure time.
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
More information about the samba-technical