In this function: omapi_wait_for_completion

omapi_object_t *inner;

if (object) {
       waiter = (omapi_waiter_object_t *)0;
       ....

0 is being cated to an omapi_waiter_object_t pointer. What is the purpose?

I know a similar question exists: Casting NULL to a struct pointer in C?, but the answer is about validity using macro. In my case, no macro involves. I want to know why it is cast that way.

有帮助吗?

解决方案

Sometimes, people just write useless code.

There is no sense in actually writing the cast here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top