| United States-English |
|
|
|
![]() |
HP-UX Systems: HP C/HP-UX Release Notes > Chapter 1 HP
C/HP-UX Release NotesNew Features in Version B.11.11.08 |
|
HP C compiler version B.11.11.08 supports the following new features: This is a C99 feature. The restrict keyword tells the optimizer that variables declared as restrict cannot have aliases (using pointers). Thus the optimizer can do better alias analysis. As of the current release, only the keyword is supported without any accompanying optimizations. A typeof-construct can be used anywhere a typedef name is used. For example, you can use it in a declaration, in a cast, or inside of sizeof or __typeof__. __typeof__ is another way to refer to the type of an expression. This example declares y as an array of type of what x points to. __typeof__ (*x) y[4]; This declares y as an array of pointers to characters: __typeof__(__typeof__(char *)[4]) y; This keyword can be used to indicate to the optimizer that the associated variable declared with this qualifier will not have aliases (using pointers). This will help in better code optimization.
Examples: int a = 10; int *__restrict__ b = &a; This option needs to be used in order to use the C99 specific features. For example, it enables keywords like restrict, and typeof to be recognized. (Without this option, the keywords __restrict__ and __typeof__ need to be used). Using this option causes the compiler warnings n1, n2, ..., nN to be converted into error messages. If no numbers are specified, then most warnings, except a selected few, are converted into errors. Now it is possible to specify non-constant expressions as initializers in the initialization lists of aggregates, such as arrays and structures. The expressions can be any valid C expressions, such as arithmetic expressions involving variables, and even function calls. Earlier it was only possible to specify constant expressions as initializers of aggregates. Example usage:
This option causes the compiler to insert <file> at the beginning of a set of translation units, before processing the translation units.Effectively, it executes implicit #include "<file>" directives for each -include <file> option on the command line, before the very first line of each of the source files specified on the command line. This is a GCC compatibility feature. Example Usage: $ cc [cc opts] [-include <file>]* [cc opts] <source file(s)> where, [-include <file>]* stands for 0 or more -include <file> options. All the -include options are processed in the order in which they are written. This option allows the user to turn on[off] the cloning facility of the optimizer. Cloning is on by default. It is mainly provided for users who may see a lot of cloning adversely affecting the performance of their code. If inlining is turned off, cloning is turned off by default. You cannot specify +Onoinline +Oclone. The +Olit option specifies the type of data items placed in the read-only data section. It can take the values all, const and none. +Olit=all places all string variables and all const-qualified variables that do not require load-time or run-time initialization in the read-only data section. +Olit=const places all string literals appearing in a context where const char * is legal, and all const-qualified variables that do not require load-time or run-time initialization in the read-only data section. If +Olit=none is specified, no constants are placed in the read-only data section. This option enables[disables] memory optimizations. Specifying malloc in the list enables[disables] optimizations which consolidate memory allocation procedure calls. This option is disabled by default. It is incompatible with +OopenMP and +Oparallel, and is ignored when these options are in effect. Assigned goto is a gcc compatibility feature, to use labels as values. The address of a label defined in the current function can be got using the unary operator &&. The value has type void *. For example:
To use these values, the user must be able to jump to one. This is done with the computed goto statement(1), goto *EXP;. For example, goto *ptr; Any expression of type void * is allowed. A local label is simply an identifier. You can jump to it with an ordinary goto statement, but only from within the compound statement it belongs to. The syntax for a local label is given below: __label__ LABEL; or __label__ LABEL1, LABEL2, ...; HP C does not emit debug information for unused objects (structures, unions, and others) anymore with the -g option. For getting the older behavior (emitting debug information for all objects, irrespective of whether they are used in the program or not), the environment variable HPC_DEBUG_COMPAT can be set in the environment along with the -g option in the compilation command line. It suffices to define this environment variable to have an empty string; it does not need to be set to any particular value. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||