User manual

Table Of Contents
224
mikoC PRO for PIC32
MikroElektronika
Linkage Rules
Local names have internal linkage; the same identier can be used in different les to signify different objects. Global
names have external linkage; identier signies the same object throughout all program les.
If the same identier appears with both internal and external linkage within the same le, the identier will have internal
linkage.
Internal Linkage Rules
1. names having le scope, explicitly declared as static, have internal linkage
2. names having le scope, explicitly declared as const and not explicitly declared as extern, have
internal linkage
3. typedef names have internal linkage
4. enumeration constants have internal linkage
External Linkage Rules
1. names having le scope, that do not comply to any of previously stated internal linkage rules, have
external linkage
The storage class speciers auto and register cannot appear in an external declaration. No more than one external
denition can be given for each identier in a translation unit declared with internal linkage. An external denition is
an external declaration that denes an object or a function and also allocates a storage. If an identier declared with
external linkage is used in an expression (other than as part of the operand of sizeof), then exactly one external
denition of that identier must be somewhere in the entire program.
Storage Classes
Associating identiers with objects requires each identier to have at least two attributes: storage class and type
(sometimes referred to as data type). The mikroC PRO for PIC32 compiler deduces these attributes from implicit or
explicit declarations in the source code.
A storage class dictates the location (data segment, register, heap, or stack) of object and its duration or lifetime (the
entire running time of the program, or during execution of some blocks of code). A storage class can be established by
the syntax of a declaration, by its placement in the source code, or by both of these factors:
storage-class type identier
The storage class speciers in the mikroC PRO for PIC32 are:
- auto
- register
- static
- extern