HP C B.11.11.16 Release Notes
HP C/ANSI C Release Notes
What’s in This Version
Chapter 16
};
void print_val(struct Val *valp){
switch (valp->tp) {
case tp_char:
printf("%c", valp->c);
case tp_int:
printf("%d", valp->i);
case tp_double:
printf("%lf", valp->d);
}
}
As can be seen, the members of an unnamed union can be accessed directly without the need
to specify a name for the union. This is very useful when specifying the union name with each
access of its members proves to be a syntactic overhead, without making the code any more
readable or comprehensible.
Unnamed structs have similar syntax and offer similar conveneince.
Support for UNIX 2003 Standard
The HP C drivers now support the UNIX 2003 standard on 11.31. If the environment variable
UNIX_STD is set to 2003, the HP C drivers automatically link in the appropriate support
object with the executable, provided it is present on the system. Linking in the UNIX 2003
support object enables the standard C library functions to provide behavior that conforms to
the UNIX 2003 standard.
Following are the UNIX 2003 configuration files present in the system:
/usr/lib/unix2003.o (for 32-bit executables)
/usr/lib/pa20_64/unix2003.o (for 64-bit executables)
The HP C compiler already supports the UNIX 1998 and 1995 standards.
Support for Flexible Array Members (C99)
This version of HP C supports flexible array members, which allow array structure members
with unspecified bounds. A flexible array member can be an element of a structure with one
or more named members, and can be used to access a variable-length object. It is declared
with an empty index.
Example:
struct Foo {
int a;
int b[]; /* A flexible array member. */
};