24.4.12 Indicating Antiquated Objects
The __deprecate
specifier can be used to indicate that an object has
limited longevity and should not be used in new designs. It is commonly used by the
compiler vendor to indicate that compiler extensions or features can become obsolete, or
that better features have been developed and should be used in preference.
Use the native keywords discussed in the Differences section to look up information on the semantics of this specifier.
Example
The following shows a function that uses the __deprecate
keyword.
void __deprecate getValue(int mode)
{
//...
}
Differences
When targeting AVR MCUs using the MPLAB XC8 compiler or when using the other compilers,
the deprecated
attribute (note the different spelling to the CCI
specifier) has been used to indicate that use of certain objects should be avoided, if
possible.
Migration to the CCI
When building with MPLAB XC16, XC-DSC or XC32 compilers, or with the MPLAB XC8 compiler
for AVR MCUs, change any occurrence of the deprecated
attribute to
__deprecate
, for example, from:
int __attribute__(deprecated) intMask;
to:
int __deprecate intMask;
Caveats
None.