Compiling CVS HEAD with clang under OSX - Mailing list pgsql-hackers

From Neil Conway
Subject Compiling CVS HEAD with clang under OSX
Date
Msg-id AANLkTi=SDfLWxrM0qr672sMXAt2YGjnFW9Sm9ag2-VoK@mail.gmail.com
Whole thread Raw
Responses Re: Compiling CVS HEAD with clang under OSX
Re: Compiling CVS HEAD with clang under OSX
Re: Compiling CVS HEAD with clang under OSX
Re: Compiling CVS HEAD with clang under OSX
List pgsql-hackers
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.

(2) clang doesn't support (or require) "-no-cpp-precomp", which
src/template/darwin adds to $CC unconditionally. Adding the flag
unconditionally seems wrong regardless: e.g., -no-cpp-precomp isn't
supported by FSF GCC on OSX either. clang is happy to ignore the flag,
but it just emits countless "warning: argument unused during
compilation: '-no-cpp-precomp'" -- not sure the best way to fix this.
Perhaps have configure grep for "apple" in "gcc --version"?

(As an aside, is "no-cpp-precomp" still necessary for
reasonably-modern versions of Apple GCC?)

(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. We could also specify -Wno-unused-value, but probably not
worth bothering just for clang.

Neil

Attachment

pgsql-hackers by date:

Previous
From: Mike Fowler
Date:
Subject: Initial review of xslt with no limits patch
Next
From: Tom Lane
Date:
Subject: Re: Compiling CVS HEAD with clang under OSX