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

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

On 24.05.2011 20:44, Tom Lane wrote:
> BTW, is it really true that HP decided they could make the compiler's
> default behavior violate the C standard so flagrantly? I could believe
> offering a switch that you had to specify to save a few cycles at the
> cost of nonstandard behavior; but if your report is actually correct,
> their engineering standards have gone way downhill since I worked there.
> I wonder whether you are inserting some other nonstandard switch that
> turns on this effect.

This (http://docs.hp.com/en/B3901-90015/ch02s07.html) says:

> +O[no]libmerrno
>
> Description:
>
> This option enables[disables] support for errno in libm functions. The default is +Onolibmerrno.
>
> In C++ C-mode, the default is +Olibmerrno with -Aa option.

So the default is indeed non-standard. But I wonder if we should use -Aa
instead? The documentation I found for -Aa
(http://docs.hp.com/en/B3901-90017/ch02s22.html) says:

> -Aa
>
> The -Aa option instructs the compiler to use Koenig lookup and strict ANSI for scope rules. This option is equivalent to specifying -Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on.
>
> The default is off. Refer to -Ae option for C++ C-mode description. The standard features enabled by -Aa are incompatible with earlier C and C++ features.

That sounds like what we want. Apparently that description is not
complete, and -Aa changes some other behavior to ANSI C compatible as
well, like +Olibmerrno. There's also -AC99, which specifies compiling in
C99-mode - I wonder if that sets +Olibmerrno too.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-05-24 18:00:54 Re: Domains versus polymorphic functions, redux
Previous Message Andrew Dunstan 2011-05-24 17:56:26 Re: "errno" not set in case of "libm" functions (HPUX)