Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

5.2 Using Pragmas for Finer Control

For cases in which type-based analysis can benefit from more detail, you can use the pragmas described in this section to override the alias level in effect and specify the aliasing relationships between individual types or pointer variables in the translation unit. These pragmas provide the most benefit when the use of pointers in a translation unit is consistent with one of the available alias levels while a few specific pointer variables are used in an irregular way not allowed by one of the available levels.


Note - If you do not declare the named type or variable prior to the pragma, a warning message is issued and the pragma is ignored. The results of the program are undefined if the pragma appears after the first memory reference to which its meaning applies.

The terms listed in the following table are used in the pragma definitions.

Term
Meaning
level
Any of the alias levels listed under -xalias_level[=l].
type
Any of the following:
  • char, short, int, long, long long, float, double, long double

  • void, which denotes all pointer types

  • typedef name, which is the name of a defined type from a typedef declaration

  • struct name, which is the keyword struct followed by a struct tag name

  • union, which is the keyword union followed by a union tag name

pointer_name
The name of any variable of pointer type in the translation unit.