Re: LLVM / clang - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: LLVM / clang
Date
Msg-id 1277495380.5356.17.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: LLVM / clang  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: LLVM / clang
Re: LLVM / clang
List pgsql-hackers
On fre, 2010-06-11 at 07:00 +0300, Peter Eisentraut wrote:
> The second problem is that the prototype check for accept() fails.
> This
> is because glibc defines the second argument to be a "transparent
> union", apparently to make it look like a lot of things at once.
> clang
> apparently doesn't understand that.  One could address this by
> checking
> for the typedef that glibc uses explicitly in the configure check, but
> that would appear to defeat the point of the *transparent* union.  A
> workaround is to remove -D_GNU_SOURCE from src/template/linux.
>
> Predictably, this will make PL/Perl fail to build.
>
> Also, it will make src/backend/libpq/auth.c fail to build, because
> struct ucred is only defined when _GNU_SOURCE is used.  This would
> actually fail to work on GCC as well, so I think we should add an
> explicit configure check for struct ucred.

For the record, here is a patch that would address these issues.

At the moment, I'm waiting to get my hands on the new version 2.7 of
clang to see if some of these issues have gone away.

Considering that clang already helped us find one bug in the code, I
think it's worth trying to make this work.

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Admission Control
Next
From: "Kevin Grittner"
Date:
Subject: Re: Admission Control