[BusyBox] Clean up
Rob Landley
rob at landley.net
Wed Jul 27 01:46:57 UTC 2005
On Tuesday 26 July 2005 09:09, Jason Schoon wrote:
> That was basically my original idea, but Rob pointed out that
> multiline blocks are really messy in that scenario.
>
> I think from a preprocessor and compiler standpoint it is all cool,
> but you will make some people scratch their heads the first time they
> see:
>
> CLEAN_UP({free(foo); close(sockfd)});
>
> Curly braces inside of parens just isn't something you generally see.
Actually the thing you can't get away with is _semicolons_, which normal C
doesn't have inside of parentheses.
These are normal C: understandable by anybody who knows the language:
if(test) thing();
if(test) {
thing(a);
thing(b);
thing(c);
}
This isn't:
CLEAN_UP(
thing(a);
thing(b);
thing(c);
)
The c-like alternative is:
CLEAN_UP(thing(a));
CLEAN_UP(thing(b));
CLEAN_UP(thing(c));
Which isn't really an improvement.
More information about the busybox
mailing list