Void function is throwing a "no return statement" warning

Viewed 1739

So I have the following function, evidently a void:

static void *CpuStatsTestLoop (void *arg){
    UNUSED (arg);

    rtems_object_set_name(rtems_task_self(), "CPU Usage Thread");

    while (1)
    {
        sleep (CPU_USAGE_REPORT_INTERVAL_SECS);
        rtems_cpu_usage_report();
        rtems_cpu_usage_reset();
    }  
}

and it throws

"cpu_stats.c:98:1: warning: no return statement in function returning non-void [-Wreturn-type]".

I've tried adding a blank return and return 0 with no luck.

Any idea about why it's throwing this error, and how to fix?

2 Answers
Related