C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

G c99 Selected Features (C99LITE)
This appendix summarizes the subset of features from the 1999 update to the ISO/IEC standard
for C (ISO/IEC 9899:1999, also known as c99) that are supported by the HP C compiler on
systems running H06.08 and later H-series RVUs and J06.03 and later J-series RVUs. By default,
these features are not recognized by the C compiler; you must specify the C99LITE pragma on
the compiler RUN command (Guardian) or the -Wc99lite option on the c89 command (OSS,
Windows) to use these features. These features are supported only by the TNS/E native C compiler;
they are not supported by the TNS C, TNS/R C, or C++ compilers.
NOTE: H06.21 and later H-series RVUs and J06.10 and later J-series RVUs also include full
support for the c99 standard for TNS/E native applications that use IEEE floating point. Complex
types and several new math functions and macros are not supported for Tandem floating point
format, but all other c99 features are available when compiled using the Tandem floating point
format option. For more information about this support, see “c99 Full Support” (page 461).
The relevant sections of the C standard are cited inside the brackets.
__func__ Identifier
The __func__ identifier provides a string representing the name of the current function, or an
empty string if it appears outside of a function. An existing HP extension, the __FUNCTION__
macro, provides the same functionality. [6.4.2.2, Predefined identifiers]
Example
#include <stdio.h>
void myfunc(void) {
printf ("%s\n", __func__); // prints myfunc
}
Universal Character Names
A universal character name has one of these forms:
\unnnn
\Unnnnnnnn
where n is a hexadecimal digit.
Universal character names can be used in identifiers, character constants, and string literals to
designate characters that are not in the basic character set, such as non-English characters. [6.4.3,
Universal character names]
Example
char *ptr = "\u0024";
Hexadecimal Floating Point Constants
Floating point constants can be expressed using hexadecimal digits. [6.4.4.2, Floating constants]
Example
Float f = 0x3F.Cp1
__func__ Identifier 457