A declaration establishes the names and characteristics of data objects used in a program. A definition allocates storage for data objects, and associates an identifier with that object. When you declare or define a type, no storage is allocated.
The following table shows examples of declarations and definitions. The identifiers declared in the first column do not allocate storage; they refer to a corresponding definition. The identifiers declared in the second column allocate storage; they are both declarations and definitions.
| Declarations | Declarations and definitions |
|---|---|
| extern double pi; | double pi = 3.14159265; |
| struct payroll; | struct payroll { |
In addition, for compatibility with
GCC, XL C allows
you to use attributes to modify the properties of data objects. Type attributes, which can be used to modify
the definition of user-defined types, are described in Type attributes (IBM extension). Variable attributes,
which can be used to modify the declaration of variables, are described
in Variable attributes (IBM extension). 
All declarations have the form:
Data declaration syntax .-----------------------------. .--------------------. V | V | >>---+-------------------------+-+----+----------------+-+------> '-storage_class_specifier-' '-type_qualifier-' .-,---------------------------. V | >--type_specifier----declarator--+-------------+-+--;---------->< '-initializer-'
A tentative definition is any external data declaration that has no storage class specifier and no initializer. A tentative definition becomes a full definition if the end of the translation unit is reached and no definition has appeared with an initializer for the identifier. In this situation, the compiler reserves uninitialized space for the object defined.
int i1 = 10; /* definition, external linkage */
static int i2 = 20; /* definition, internal linkage */
extern int i3 = 30; /* definition, external linkage */
int i4; /* tentative definition, external linkage */
static int i5; /* tentative definition, internal linkage */
int i1; /* valid tentative definition */
int i2; /* not legal, linkage disagreement with previous */
int i3; /* valid tentative definition */
int i4; /* valid tentative definition */
int i5; /* not legal, linkage disagreement with previous */