That assumes 'x' is an lvalue, which it may very well not be (thus causing compilation errors, which would presumably get caught pretty quickly).
There's also people doing stupid shit like free(&x), but those people don't need evil macros to dick up their code. :)
While this is C++, I've actually seen this particular construct: delete new SomeClass(...);
used as, basically, an eye-poppingly clever way of initializing something, doing work, and then cleaning up after.
{ SomeClass makeitso; }
:)Also, free(ptr++) is broken by design, the post increment value is useless. But free(*ptr++) is a good case.
Yes, of course - that's what I thought I'd written. Clearly not :)
And then later it passes that return value to some function that deallocates the block, by calling free(((char *)p) - n).