Question: I have a function-like macro that takes in an enum return code and a function call.

```
#define HANDLE_CALL(result,call) \
    do { \
        Result callResult = call; \
        Result* resultVar = (Result*)result; \
        // some additional processing
        (*resultVar) = callResult; \
    } while(0)

```

Does fancy pointer casting to `Result*` and subsequent de-referencing gain you anything? That is, is there any advantage to doing this over just:

```
callResult = call;
// additional processing
*result = callResult;

```

The macro is used like this:

```
Result result;
HANDLE_CALL(&result,some_function());

```

By the way, this isn't my code and I'm not a power C user so I'm just trying to understand if there is any logic behind doing this.

Answer: 
As Steve says, the cast is to be able to pass something different than `Result*` to the macro. But I think it just shouldn't do the cast, this is dangerous, but only the initialization. Better would be 

```
#define HANDLE_CALL(result,call)         \
    do {                                 \
        Result callResult = (call);      \
        Result* resultVar = (result);    \
        /* some additional processing */ \
        (*resultVar) = callResult;       \
    } while(0)

```

this would enforce that `result` is assignment compatible to `Result*`, so it could either be `Result*` or `void*`. All other uses to force-cast a (pointer to a larger structure) to (its first field of type `Result`) or so, are useless playing with fire.
It all depends on the daft things people pass in to the instantiations. Do you really need a macro - an inline function would be better.