HPlogo HP-UX/HP C Compiler: HP C/HP-UX Reference Manual > Chapter 10 HP C/HP-UX Implementation Topics

Library Functions and Header Files

» 

Technical documentation

Complete book in PDF

 » Table of Contents

This section describes the implementation of library functions in HP C/HP-UX. For complete information about library functions on HP C/HP-UX, see the HP-UX Reference manual and HP-UX Linker and Libraries Online User Guide.

The Math Library

When using any of the mathematical functions in the <math.h> header, you must include the -lm flag on the cc or ld command when linking. This will cause the linker to link in the appropriate math library.

NOTE: C math libraries have traditionally used a function called matherr, which was required by the SVID2 specification but is not specified by ANSI C, SVID3, or XPG4.2. In the HP-UX math library, the SVID2 matherr function exists under the names matherr and _matherr. These functions are still provided in libm.a to assist in supporting old programs. Executables built at HP-UX releases 10.0 through 10.20 that use matherr or _matherr will continue to run at the next release of HP-UX. However, these functions are obsolete and will not be supported for newly compiled or linked programs at the next release of HP-UX.

Refer to the HP-UX Floating-Point Guide for further details.

Other Library Functions

  • longjmp: Because HP C/HP-UX can place automatic variables in registers, you cannot rely on their values if they are changed between the setjmp and longjmp functions.

  • setjmp: There are no restrictions on when calls to setjmp can be made.

© Hewlett-Packard Development Company, L.P.