Re: psqlodbc: HEAD fails to build with recent clang

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Alex Dunn <dunn(dot)alex(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: psqlodbc: HEAD fails to build with recent clang
Date: 2015-05-06 23:25:49
Message-ID: 554AA2FD.4090705@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 05/06/2015 07:07 AM, Alex Dunn wrote:
> Beginning (I think) in Mavericks, Clang has begun taking functions and
> defining them as macros; they then conflict with declarations via
> headers. I think this is what's happening with `strlcat` in the most
> recent psqlodbc, since it builds fine with GCC.
>
> Here are the build logs with system info (errors start at L15 of 03.make):
> https://gist.github.com/dunn/f6ed7ac29a23aa06ba65#file-03-make-L15
>
> Clang is: Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)

Hmm, I think this is because there's a typo in our misc.h header file
(it was checking HAVE_STRLCPY instead of HAVE_STRLCAT), and because of
the typo it always defines a prototype for strlcat(), even when the
system provides that function. And that prototype then conflicts with
the one from the system headers.

I've pushed a fix to that, I hope it fixed the build for you.

- Heikki

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alex Dunn 2015-05-07 00:25:56 Re: psqlodbc: HEAD fails to build with recent clang
Previous Message Andres Freund 2015-05-06 21:03:39 Re: BUG #13246: Failure to pg_terminate_backend