Re: Problem while building SRPM PostgreSQL on Red Hat Linux

From: Joe Conway <mail(at)joeconway(dot)com>
To:
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Devrim GUNDUZ <devrim(at)gunduz(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Problem while building SRPM PostgreSQL on Red Hat Linux
Date: 2003-04-13 01:52:36
Message-ID: 3E98C2E4.8010501@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Conway wrote:
> Tom Lane wrote:
>> I'm betting the system headers define a macro isblank(). I've always
>> wondered why we don't have more trouble with that.
>>
>> Try putting "#ifndef isblank ... #endif" around the isblank function
>> in hba.c.
>
> I just ran into the exact same issue with cvs tip on Red Hat 9. The
> ifndef does the trick.
>

The committed fix now gives me this:

i386-redhat-linux-gcc -O2 -g -Wall -Wmissing-prototypes
-Wmissing-declarations -I../../../src/include -I/usr/kerberos/include
-c -o hba.o hba.c -MMD
hba.c:82: conflicting types for `isblank'
/usr/include/ctype.h:128: previous declaration of `isblank'
make[3]: *** [hba.o] Error 1

Any reason not to apply the following?

Joe

Index: src/backend/libpq/hba.c
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/backend/libpq/hba.c,v
retrieving revision 1.97
diff -c -r1.97 hba.c
*** src/backend/libpq/hba.c 12 Apr 2003 22:28:33 -0000 1.97
--- src/backend/libpq/hba.c 13 Apr 2003 02:26:45 -0000
***************
*** 73,88 ****
* Others, including Solaris, do not. So we have our own. Watch out for
* macro-ized versions, too.
*/
! #ifdef isblank
! #undef isblank
! #endif
!
static bool
isblank(const char c)
{
return c == ' ' || c == '\t' || c == '\r';
}
!

/*
* Grab one token out of fp. Tokens are strings of non-blank
--- 73,85 ----
* Others, including Solaris, do not. So we have our own. Watch out for
* macro-ized versions, too.
*/
! #ifndef isblank
static bool
isblank(const char c)
{
return c == ' ' || c == '\t' || c == '\r';
}
! #endif

/*
* Grab one token out of fp. Tokens are strings of non-blank

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-13 03:47:16 Re: Problem while building SRPM PostgreSQL on Red Hat Linux
Previous Message Ed L. 2003-04-13 01:12:24 Re: Batch replication ordering (was Re: [GENERAL] 32/64-bit