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

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -