Domanda

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.

È stato utile?

Soluzione

Sometimes, people just write useless code.

There is no sense in actually writing the cast here.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top