Chapter Contents

Previous

Next
Extended Names

Using #pragma map to Create Constant External Symbols

It is impossible to predict what external symbol the compiler or COOL will create for an extended name. This unpredictability can cause problems when a constant, predictable symbol is required for a name.

For example, the ANSI Standard function name localtime is nine characters in length. The extname compiler option would treat this name as an extended name. The program that calls localtime must have a predictable symbol for the name or it will not be possible to link the localtime function into the program properly.

The #pragma map statement assigns an external symbol name to an extended name. For example, the following statement assigns the external symbol name #LOCALTM to the localtime extended name:

#pragma map (localtime, "#LOCALTM")

In the object file generated by the compiler, the external symbol for localtime is #LOCALTM , not @@xxxxxx . For more information on #pragma map , refer to Source Code Conventions.

Note:    Use of the enexit option, described in COOL Options may be a more useful technique than #pragma map for very large applications or for applications where the external names in use are not easily predictable.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.