Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 132 2012-2013 Microchip Technology Inc.
deprecated
The deprecated attribute causes the declaration to which it is attached to be specially
recognized by the compiler. When a deprecated function or variable is used, the
compiler will emit a warning.
A deprecated definition is still defined and, therefore, present in any object file. For
example, compiling the following file:
int __attribute__((__deprecated__)) i;
int main() {
return i;
}
will produce the warning:
deprecated.c:4: warning: `i is deprecated (declared
at deprecated.c:1)
i is still defined in the resulting object file in the normal way.
eds
In the attribute context, the eds (extended data space) attribute indicates to the com-
piler that the variable will be allocated anywhere within data memory. Variables with this
attribute will likely also the __eds__ type qualifier (see Section 10.7 Extended Data
Space Access) for the compiler to properly generate the correct access sequence.
Not that the __eds__ qualifier and the eds attribute are closely related, but not identi-
cal. On some devices, eds may need to be specified when allocating variables into cer-
tain memory spaces such as space (ymemory) or space (dma) as this memory
may only exist in the extended data space.
fillupper
This attribute can be used to specify the upper byte of a variable stored into a
space(prog) section.
For example:
int foo[26] __attribute__((space(prog),fillupper(0x23))) = { 0xDEAD };
will fill the upper bytes of array foo with 0x23, instead of 0x00. foo[0] will still be
initialized to 0xDEAD.
The command line option -mfillupper=0x23 will perform the same function.
far
The far attribute tells the compiler that the variable will not necessarily be allocated in
near (first 8 KB) data space, (i.e., the variable can be located anywhere in data memory
between 0x0000 and 0x7FFF).
mode (mode)
This attribute specifies the data type for the declaration as whichever type corresponds
to the mode mode. This in effect lets you request an integer or floating point type
according to its width. Valid values for mode are as follows:
Mode Width Compiler Type
QI 8 bits char
HI 16 bits int
SI 32 bits long
DI 64 bits long long
SF 32 bits float
DF 64 bits long double

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh