IA64 HP-UX patch for setting errno

Zack Weinberg zack@codesourcery.com
Thu Jun 20 10:23:00 GMT 2002


On Thu, Jun 20, 2002 at 09:45:07AM -0700, Steve Ellcey wrote:
> This is another patch for IA64 HP-UX support.  On this platform most of
> the standard math routines in libm do not set errno.  There are special
> routines (with _e suffixes) that do set errno and this patch is to add a
> new header file that maps the normal names to the *_e names when -ansi
> or -std=c89 is given and math.h is included.  The HP compiler does this
> mapping internally based on options and on seeing the builtin pragma
> that is in math.h.  We just use a #define in a new header file,
> matherrno.h.

It would be better to implement support for this #pragma, so that you
need not edit the header file at all.  Failing that, enable #pragma
redefine_extname and use that instead of #define to map the names.
#define will not do the right thing under all conditions.

The naming convention HP is using is poorly chosen -- very high risk
of collisions.  (e.g. if C2010 adds a math routine zeta(): _Zeta_e
falls into the namespace reserved for C++ mangled names).  But I
suppose that is not our problem.

zw



More information about the Gcc-patches mailing list