On Tue, 2016-01-19 at 09:46 +0100, Lukas Slebodnik wrote:
> On (18/01/16 18:03), Simo Sorce wrote:
> >Found this while working on another patch.
> >
> >It is not evident by this patch alone but ... "trust me" :-)
> >(I'll send the other patch next, try to apply just that one and see what
> >I mean if you want)
> >
> Then probably you have something bad in your patches.
> 
> It's best practice to include system beader file before
> local header file and you changed that.

Sorry Lukas, but I have to call BS on this.

> I will wait for your another patch and I will try to propose
> different solution :-)

The other patch is already on the list, and I can also describe exactly
what is wrong with current headers.

[NOTE: I am going from memory so I may get a system config file name
wrong here and there, follow the essencce not the letter please]

They includes system files before config.h, system headers (as any other
are included only once after which they #define themselves off, and most
system headers end up calling each other.

Specifically what happens here is that because a system header is
include before config.h it does *not* see the _GNU_SOURCE macro defined
there, and therefore sys/types.h (which is included by pretty much
anything) ends up *not* defining __USE_GNU internally. This in turn ends
up causing things like struct ucred to not be defined at all as they are
guarded by __USE_GNU.

If you want to include system headers *before "config.h" that is a valid
choice but then you'll have to move all declarations like _GNU_SOURCE
into makefile -D variables and not incllude them in config.h because
then it is too late.

If you want to go that approach, feel free to do it as well, but unless
you do that within a short time, for now we should fix the headers.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/sssd-devel@lists.fedorahosted.org

Reply via email to