I'd like to define a macro along the lines of the following:

```
#define MYCheckedCall(stmnt) do {         \
    status_t status = (stmnt);            \
    if (MYFail(status)) {                 \
        MYLog("Statement failed!");       \
    }                                     \
} while (0)

```

And use it throughout the applications every few calls. What is the performance characteristics of this versus just repeating the code every where? (i.e. only define status\_t once and no extra {} scope)

Couple of points to note:

* This adds a frame to the stack (to store the `status_t` variable) thus my curiosity about perf.
* status\_t is `typedef int status_t` or something similar.
* This will be used for like half of the code of the entire lib.

I know this is a bit of premature optimization but just wanna know about it regardless since it seems like it should've been a trivial decision?

---

Example of what the code looks like right now (without the macro):

```
status_t status = 0;
status = call1();
if (MYFail(status)) MYLog("call1 failed!");

status = call2();
if (MYFail(status)) MYLog("call2 failed!");

```

Example of what I'd like it be with the macro:

```
MYCheckedCall( call1() );
MYCheckedCall( call2() );

```

If I'm just being C noob and there is a better pattern/way to implement this kind of functionality, I'd would love to know about it as well.

I'm using clang/llvm-gcc on Mac OS X 10.7.