To declare main() to be a non-returning function in IAR, it is done like this:

__C_task void main(void)
{
    // code
}

To do the equivalent in AVR GCC, do this:

void main(void) __attribute__((noreturn));
        
void main(void)
{
    //...
}

In AVR GCC, a prototype for main() is required so you can declare the function attribute to specify that the main() function is of type "noreturn". Then, define main() as normal. Note that the return type for main() is now void.