Re: AIX support

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Aditya Kamath <Aditya(dot)Kamath1(at)ibm(dot)com>
Cc: Srirama Kucherlapati <sriram(dot)rk(at)in(dot)ibm(dot)com>, "peter(at)eisentraut(dot)org" <peter(at)eisentraut(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "hlinnaka(at)iki(dot)fi" <hlinnaka(at)iki(dot)fi>, "tristan(at)partin(dot)io" <tristan(at)partin(dot)io>, "postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com" <postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com>
Subject: Re: AIX support
Date: 2026-01-28 15:54:47
Message-ID: 202601281533.bq3epjmozbjc@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Jan-28, Aditya Kamath wrote:

> Below is the error message we get in AIX if we do not use '-D_H_FLOAT’
> FAILED: src/backend/utils/activity/wait_event_names.a.p/wait_event_funcs.c.o
> gcc -Isrc/backend/utils/activity/wait_event_names.a.p -Isrc/include/utils -I../src/include/utils -Isrc/include -I../src/include -I/opt/freeware/include -I/opt/freeware/include/libxml2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wdeclaration-after-statement -Wno-format-truncation -Wno-stringop-truncation -maix64 -fPIC -pthread -DBUILDING_DLL1233 -MD -MQ
> ./src/include/utils/float.h:28:19: error: expected ';' before 'int'
> 28 | extern PGDLLIMPORT int extra_float_digits;

This makes no sense to me.

> There is a clear missing of float.h definitions, the reason being
> float.h got included before "src/include/c.h”.

We have a rule that postgres.h must always go first in all our backend
source files, and wait_event_funcs.c is no exception. This file
includes postgres.h before anything else; and postgres.h in turns
includes c.h before anything else. So the claim that "float.h" got
somehow included before c.h is not easy to believe. Also,
wait_event_funcs.c does not include "float.h".

Note also that we don't have all that many places that include
<float.h>. So why is float.h being included by wait_event_names.c?

> Kindly observe the command "-I../src/include/utils” flag came in the front.

This only means that if your source code asks for any files to be
included, they will be sought there. It does not imply to actually
include any files.

Maybe you can post the output of doing "gcc -E" for the file where this
breaks in your system (without the -D_FLOAT_H of course), that is the
output of the C preprocessor, to try to understand what it is doing.

... Oh, I see now that gcc's manpage says there's a distinction between
-I and -iquote:

-I dir
-iquote dir
[...]
Directories specified with -iquote apply only to the
quote form of the directive, "#include "file"".
Directories specified with -I, -isystem, or -idirafter
apply to lookup for both the "#include "file"" and
"#include <file>" directives.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end." (2nd Commandment for C programmers)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-01-28 16:04:49 Re: Custom oauth validator options
Previous Message Robert Haas 2026-01-28 15:41:52 Re: AIX support