Frage

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.

War es hilfreich?

Lösung

Sometimes, people just write useless code.

There is no sense in actually writing the cast here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top