3.18 __no_init Keyword

The IAR __no_init keyword specifies that the qualified object is not initialized by the runtime startup code.

Suggested Replacement

There is a MPLAB XC8 specifier that performs a similar task.

Use the __persistent specifier or (or its expanded form, __attribute__((persistent)) with the object's definition.

Caveats

The Common C Interface must be enabled using -mext=cci to use the __persistent specifier form.

Examples

Consider migrating IAR code such as:
volatile __no_init int x;
int main(void) {
    x = 2;
    return 0;
}
to MPLAB XC8 codes similar to:
#include <xc.h>
 
volatile __persistent int x;
int main(void) {
    x = 2;
    return 0;
}

Further Information

See the Attributes and Options for Controlling the C Dialect sections in the MPLAB XC8 C Compiler User's Guide for AVR MCUs for more information on this option and attribute.