c - What does the macro _bnd(X,bnd) mean? -
recently read implement own printf use macro _bnd(x,bnd),but don't understand mean of macro.
#define _bnd(x, bnd) (sizeof(x) + (bnd) & ~(bnd))
i know bitwise operator , sizeof()
it's internal implementation magic, playing implementation-dependent properties of addresses of arguments variable-argument functions.
unless need know means, best stay away it. otherwise may tempt rely on it.
and macro should be
#define _bnd(x, bnd) (sizeof(x) + (bnd) & ~(bnd)) ^ check in post
also can know expanding basic arrithmetic operation.for should know sizeof() , tilde operator , bitwise operatior.
Comments
Post a Comment