HP C Programmer's Guide (92434-90009)

104 Chapter4
Optimizing HP C Programs
Optimizer Pragmas
Example 1
double *d;
#pragma PTRS_STRONGLY_TYPED BEGIN
int *i;
float *f;
#pragma PTRS_STRONGLY_TYPED END
main(){
........................
}
In this example only two types, pointer-to-int and pointer-to-float will be assumed to be
type-safe.
Example 2
cc +Optrs_strongly_typed foo.c
/*source for Ex.2 */
double *d;
...
#pragma NOPTRS_STRONGLY_TYPED BEGIN
int *i;
float *f;
#pragma NOPTRS_STRONGLY_TYPED END
...
main(){
...
}
In this example all types are assumed to be type-safe except the types bracketed by
pragma NOPTRS_STRONGLY_TYPED. The command line option is required because the
default option is +Onoptrs_strongly_typed.