xdr_destroy and XDR_CONTROL are defined as "if" statements in xdr.h, but they should be expressions.
define xdr_destroy(xdrs) \
if ((xdrs)->x_ops->x_destroy) \
(*(xdrs)->x_ops->x_destroy)(xdrs)
As an "if" statement, xdr_destroy() can't appear in the increment clause of a "for" statement:
for (cond; test; xdr_destroy(xp)) { ... } // syntax error
Much worse, it can cause unexpected results when used within an if statement. Consider:
if (cond)
xdr_destroy(xdrs);
else
oops();
If xdrs->x_ops->x_destroy is NULL, then oops() will be called, which is not what the programmer would expect.
xdr_destroy and XDR_CONTROL are defined as "if" statements in xdr.h, but they should be expressions.
define xdr_destroy(xdrs) \
As an "if" statement, xdr_destroy() can't appear in the increment clause of a "for" statement: for (cond; test; xdr_destroy(xp)) { ... } // syntax error
Much worse, it can cause unexpected results when used within an if statement. Consider: if (cond) xdr_destroy(xdrs); else oops();
If xdrs->x_ops->x_destroy is NULL, then oops() will be called, which is not what the programmer would expect.