Re: Compiling CVS HEAD with clang under OSX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neil(dot)conway(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compiling CVS HEAD with clang under OSX
Date: 2010-08-02 00:25:41
Message-ID: 21008.1280708741@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neil(dot)conway(at)gmail(dot)com> writes:
> I tried $subject recently, and noticed some minor issues:
> (1) Two warnings that suggest bugs; in src/backend/utils/adt,

> datetime.c:3101:27: warning: use of logical || with constant operand;
> switch to bitwise | or remove constant

> And similarly for src/interfaces/ecpg/pgtypeslib/interval.c. Attached
> is a patch that replaces logical OR with bitwise OR, which seems to be
> the intended coding.

Yeah, this seems like an ancient typo. Will apply.

> (2) clang doesn't support (or require) "-no-cpp-precomp", which
> src/template/darwin adds to $CC unconditionally.
> ...
> (As an aside, is "no-cpp-precomp" still necessary for
> reasonably-modern versions of Apple GCC?)

Good question, but before thinking about removing it, we'd have to agree
what is a "reasonably modern" version of Apple's gcc. OSX 10.4 is still
in use in the wild, for sure. Is 10.3 still interesting?

> (3) There are countless warnings emitted during the compilation of
> regcomp.c and related files, due to unused values returned by ERR(),
> VERR(), FAILW(), and similar macros. Perhaps it is possible to rewrite
> the macros to avoid the warning, although I didn't see an easy way to
> do that.

Perhaps a tack like this would shut it up?

#define VERR(vv,e) ((vv)->nexttype = EOS, \
(vv)->err = ((vv)->err ? (vv)->err : (e)))

What are you doing exactly to build with clang ... is "CC = clang"
sufficient?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-08-02 00:56:50 Re: Compiling CVS HEAD with clang under OSX
Previous Message Neil Conway 2010-08-01 23:11:53 Compiling CVS HEAD with clang under OSX