Hi Giacinto,
You are not giving any choice here, other than rewriting gcc.
The function I have tried, and the compiler still complains.
I need a way out: please decide for the lesser evil, and I'll do it.
I already gave you two way out actually. So tell me why either of the
below wouldn't work:
So for example, the way gprs-context.c for mbim does this is just fine.
switch (method) {
case CHAP:
return ..
case PAP:
return ..
}
return something, anything;
Since the core guarantees that method will always be a valid
enumeration, the above approach is just fine and satisfies both items M7
and M12.
If you want to be more paranoid, then:
int auth_method_to_foo(enum ofono_gprs_auth_method method, uint32_t *out)
{
switch (method) {
case PAP:
*out = ..
return 0;
case CHAP:
*out = ..
return 0;
}
return -ERANGE;
}
uint32_t auth;
if (auth_method_to_foo(method, &auth) < 0)
goto error;
Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono