19.04.2015 Views

INTROL-C COMPILER REFERENCE MANUAL

INTROL-C COMPILER REFERENCE MANUAL

INTROL-C COMPILER REFERENCE MANUAL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

#undef: The #undef directive causes the named identifier to be<br />

"undefined". Thus any subsequent #ifdef and #ifndef directives which<br />

reference the identifier will operate as if it was never defined. It<br />

has the form<br />

#undef <br />

where is the name of the identifier that is to be<br />

undefined.<br />

DATA CONVENTIONS<br />

All user defined identifiers have two attributes, (1) storage class<br />

and (2) type, which are described below.<br />

STORAGE CLASS<br />

An identifier's storage class indicates the location, scope and<br />

lifetime of the storage associated with the identifier. There are<br />

four different storage classes: auto, extern, static, and register.<br />

auto: Automatic variables are local to the block or function in<br />

which they are defined. They exist only while the block or function<br />

in which they were defined is executing. Their contents are<br />

discarded upon exit from the block. Variables in a function which<br />

are not explicitly defined as having a specific storage class are<br />

assumed to be automatic (ie auto) variables.<br />

extern: External variables exist for the entire execution of the<br />

program and retain their values throughout the execution of the<br />

program. An external variable may be referenced by any function in<br />

the program file in which it was defined. Also, separately compiled<br />

program files which declare external variables of the same name<br />

refer to the same variable, thus allowing communication between<br />

separately compiled program files.<br />

In Introl-C there is little distinction made between an external<br />

"definition" and an external "declaration". It is possible to link<br />

several files together in which an external variable has been<br />

declared but never defined; the linker will simply define the<br />

variable to fit the declarations. It is also permitted to link files<br />

in which an external variable has been defined more than once; the<br />

linker will simply treat the extra definitions as if they were<br />

declarations. The linker will issue a warning if an external<br />

variable has multiple incompatible definitions in a group of files<br />

to be linked. An external variable may be initialized only once<br />

among all the program files-to be linked together.<br />

register: The idea behind the register storage class is that it may<br />

be desirable to have a frequently used variable stored in a high<br />

speed register. The register storage class is a hint to the compiler<br />

that it should, if possible, place this variable in a high speed<br />

register. In the case of Introl-C, the compiler makes most of these<br />

kinds of decisions on its own. Specifying a variable as being of<br />

C.6.6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!