I have a PowerPC build code translated using gcc cross-compiler using this function:
uint32_t fill_cache(void)
{
__asm__ ("addi 3, 0, 0\n");
}
which under PowerPC EABI returns the value calculated in R3. When compiling, I get
foo.c:105: warning: control reaches end of non-void function
Is there a way to teach gcc that the value is really coming back? Or is there a way to suppress a warning (without removing -Wall or adding -Wno- *)? I would like to very selectively suppress this warning only for this function, in order to leave the overall warning level as high as possible.
It is not possible to force this function to return void since the computed value is required by the caller.
source
share