> Does it mean that USED() can only be applied on variables of "scalar
> types"? But r is of a struct type in
yes.
>
> void
> drawresizewindow(Rectangle r)
> {
> USED(r);
>
> bad();
> }
>
> in $PLAN9/src/libdraw/nowsys-wsys.c.
>
> When compiling, 9c complains on that. A bug? Or an extension of Plan 9's
> C dialect?
In Plan 9's C compiler, USED is known to the compiler.
It makes the compiler insert a use of the variable right
there to silence used and not set warnings.
In the ports, it's a clumsy macro trying to have the same
effect.
> perhaps it could use if(&x) instead of if(x)
> to cope with structures as well
I tried this once, but then some (too smart for their
own good) compilers complain that the value is never used.
Russ