Mikroc – ABL electronic PIC Microcontrollers PIC16 User Manual

Page 96

Advertising
background image

External Linkage Rule:

1. names having file scope, that do not comply to any of previously stated internal

linkage rules, have external linkage.

The storage class specifiers

auto

and

register

cannot appear in an external

declaration. For each identifier in a translation unit declared with internal linkage,
no more than one external definition can be given. An external definition is an
external declaration that also defines an object or function; that is, it also allocates
storage. If an identifier declared with external linkage is used in an expression
(other than as part of the operand of

sizeof

), then exactly one external definition

of that identifier must be somewhere in the entire program.

mikroC allows later declarations of external names, such as arrays, structures, and
unions, to add information to earlier declarations. Here's an example:

int

a[];

// No size

struct

mystruct;

// Tag only, no member declarators

.

.

.

int

a[3] = {1, 2, 3};

// Supply size and initialize

struct

mystruct {

int

i, j;

};

// Add member declarators

mikroC - C Compiler for Microchip PIC microcontrollers

mikroC

making it simple...

88

MikroElektronika: Development tools - Books - Compilers

page

Advertising
This manual is related to the following products: