Re: ./configure error: Cannot find a working 64-bit integer type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Дилян Палаузов <dpa-postgres(at)aegee(dot)org>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ./configure error: Cannot find a working 64-bit integer type
Date: 2017-10-10 16:26:28
Message-ID: 17306.1507652788@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> The problem with configure is that it *expects* to get failures,
> and silently copes with them. This means that whenever
> $blithering_idiot_compiler_maintainer decides that some legal-per-spec
> coding pattern deserves a warning, -Werror will mean that configure
> decides that features are missing from your O/S, and then we silently
> work around them as best we can. This is not what you want to have
> happen.

Just to prove the point, I applied the proposed patch, ran configure
with CFLAGS="-O2 -Werror", and compared the output to what I normally
get.

I first had to remove --with-python, because it said that Python.h
couldn't be compiled. The logfile shows

configure:15997: gcc -c -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -Werror -I/usr/include/python2.6 -D_GNU_SOURCE conftest.c >&5
In file included from /usr/include/python2.6/pyconfig.h:6,
from /usr/include/python2.6/Python.h:8,
from conftest.c:197:
/usr/include/python2.6/pyconfig-64.h:1034:1: error: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
from conftest.c:164:
/usr/include/features.h:162:1: error: this is the location of the previous definition
In file included from /usr/include/python2.6/pyconfig.h:6,
from /usr/include/python2.6/Python.h:8,
from conftest.c:197:
/usr/include/python2.6/pyconfig-64.h:1043:1: error: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
from conftest.c:164:
/usr/include/features.h:164:1: error: this is the location of the previous definition

It's not clear to me why those complaints show up in this mode, because
I don't see them when actually building PG. So the blame might lie with
Autoconf or with Python, but in any case this is likely not something
PG could fix.

Without that option, the configure run went through, but I got all of the
attached diffs in pg_config.h, none of which are good. The build step
failed immediately, apparently because of the incorrect conclusions about
builtin bswap functions.

regards, tom lane

Attachment Content-Type Size
pg_config-diffs-with-Werror.diff text/x-diff 3.6 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-10-10 17:05:27 Re: ./configure error: Cannot find a working 64-bit integer type
Previous Message Tom Lane 2017-10-10 16:02:59 Re: ./configure error: Cannot find a working 64-bit integer type