Re: "errno" not set in case of "libm" functions (HPUX)

From: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: "errno" not set in case of "libm" functions (HPUX)
Date: 2011-05-25 16:37:20
Message-ID: BANLkTimppphfYppwDKx_ut0CokDjA6bggg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please find the updated patch. I have added this "+Olibmerrno" compile flag
check in configure/configure.in file.

OS
----
HP-UX B.11.31 U ia64

without patch
---------------
postgres=# select acos(2);
acos
------
NaN
(1 row)

with patch
-----------
postgres=# select acos(2);
ERROR: input is out of range

On Tue, May 24, 2011 at 11:13 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> > So the default is indeed non-standard. But I wonder if we should use -Aa
> > instead?
>
> Probably not; at least on older HPUX versions, -Aa turns off access to
> assorted stuff that we do want, eg "long long". "man cc" on my box
> saith
>
> -Amode Specify the compilation standard to be used by the
> compiler. mode can be one of the following letters:
>
> c (Default) Compile in a mode compatible with
> HP-UX releases prior to 7.0. (See The C
> Programming Language, First Edition by
> Kernighan and Ritchie). This option also
> defines the symbol _HPUX_SOURCE and allows the
> user to access macros and typedefs provided by
> the HPUX Operating System. The default
> compilation mode may change in future releases.
>
> a Compile under ANSI mode (ANSI programming
> language C standard ISO 9899:1990). When
> compiling under ANSI mode, the header files
> would define only those names (macros and
> typedefs) specified by the Standard. To access
> macros and typedefs that are not defined by the
> ANSI Standard but are provided by the HPUX
> Operating System, define the symbol
> _HPUX_SOURCE; or use the extension option
> described below.
>
> e Extended ANSI mode. Same as -Aa -D_HPUX_SOURCE
> +e. This would define the names (macros and
> typedefs) provided by the HPUX Operating System
> and, in addition, allow the following
> extensions: $ characters in identifier names,
> sized enums, sized bit-fields, and 64-bit
> integral type long long. Additional extensions
> may be added to this option in the future.
>
> The +e option is elsewhere stated to mean
>
> +e Enables HP value-added features while compiling
> in ANSI C mode, -Aa. This option is ignored
> with -Ac because these features are already
> provided. Features enabled:
>
> o Long pointers
> o Integral type specifiers can appear in
> enum declarations.
> o The $ character can appear in
> identifier names.
> o Missing parameters on intrinsic calls
>
> which isn't 100% consistent with what it says under -Ae, so maybe some
> additional experimentation is called for. But anyway, autoconf appears
> to think that -Ae is preferable to the combination -Aa -D_HPUX_SOURCE
> (that choice is coming from autoconf not our own code); so I'm not
> optimistic that we can get more-standard behavior by overriding that.
>
> regards, tom lane
>

--
Ibrar Ahmed

Attachment Content-Type Size
hpux_Olibmerrno_ibrar2.patch text/x-diff 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-05-25 16:37:24 Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Previous Message Vaibhav Kaushal 2011-05-25 16:36:38 Re: Expression Evaluator used for creating the plan tree / stmt ?