Python style with-statement in C
There are few problems with this macro.


It relies on an undocumented layout of FILE structure
It cannot be nested (try it with -Wshadow)
It assumes that the block is always left through the end
It may create suprises:

    for (....) {
        with_fopen(fp, ...) {
            int rc = do_something(fp);
            if (rc == -1) {
                break;
            }
        }
    }


The programmer (with or without Python background) expects the outer loop to be broken. Instead the loop hidden inside with is.


Nice try however.