A static local variable exists for the lifetime of the program.
Beware, a subsequent call to the function may change the variable.
struct a *f(..) {
static struct a x;
....
return &x; /* ok */
}
Similarly for top-level variables:
char a[10];
char *f(..) {
....
return &a; /* ok */
}