Re: "errno" not set in case of "libm" functions (HPUX) - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: "errno" not set in case of "libm" functions (HPUX)
Date
Msg-id 4DDBF228.5060802@enterprisedb.com
Whole thread Raw
In response to Re: "errno" not set in case of "libm" functions (HPUX)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: "errno" not set in case of "libm" functions (HPUX)  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
tospecifying -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
incompatiblewith 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


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: "errno" not set in case of "libm" functions (HPUX)
Next
From: Noah Misch
Date:
Subject: Re: Domains versus polymorphic functions, redux